I know It’s a shame, but I did not know Unity Application Block. I was searching for an IOC/Depedency Injection and a colleage advised me to learn Unity. If like me, you did not know the existence of Unity (developed by Microsoft), let’s take a look on Unity’s Codeplex website. They are some nice screencasts and a good doc on mdsn.
And you, what do you think about Unity ?
Note : I am also currently learning PRISM V.2, that’s a very interesting topic. PRISM uses Unity and it is why it’s important to understand how it works.
After crossing the Canada from east to west, I am back on my blog. It was a fantastic journey where I visited Toronto, Calgary, the Rockies, the Washington States, Seattle, Vancouver,… It was a fabulous experience but it was time to come back home (Belgium for me). I resigned from my job as .NET developer in Montreal and now I am searching for a job again in Europe… Maybe leaving Montreal will appear to be a mistake…
Anyway, I am jobless, but I am back. I am studying to pass my certification, so, as usual if I find something interesting to share with you, I will post it here. As you have seen or not, I created a french web site. Yeah, I know, it is still empty. This french website will contain information about general development and architecture. In fact, I think they are not enough good docs in french talking about TDD, DDD, and stuffs like that.
TenGrand is buried here, it is a site made by Microsoft Australia.
Here is the concept : We’ve buried $10,000 somewhere on the internet and the first one to find it, gets to keep it. But you’ll never find it using that browser. (So get rid of it, or get lost.) If you want a serious shot at the ten grand, upgrade your browser to Windows Internet Explorer 8 now. Then follow …
So I changed my useragent on firefox with the add-on User Agent Switcher
And here is the result :
I am not a big fan of that kind of marketing. Moreover, if you do that, please Microsoft, do it better…
Salut les Gars !
I am back with a little code I wrote today for my business. I had to create a little phone book.
The db I had to query was pretty complicated and I did not want to create all the stuff you need for an effective Linq ot Sql classes. Therefore, I decided to use a stored procedure who retrieve all the users (about 5000) with all the information I need. This application will be a one-shot application and his time life will be about 1 or 2 years. Also, the release date is very tight.
For example, you want a method who validate if a string is an email or not.
You create a static class, StringExtensions for example, you put it public static and you add a method who take a string and verify if it is a mail or not.
Like this :
</pre>
public static class StringExtensions
{
public static bool IsNotEmail (this string email)
{
var reg = new Regex(@"^(([^<>()[\]\\.,;:\s@\""]+"
+ @"(\.[^<>()[\]\\.,;:\s@\""]+)*)|(\"".+\""))@"
+ @"((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}"
+ @"\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+"
+ @"[a-zA-Z]{2,}))$");
if(reg.IsMatch(email))
{
return true;
}
return false;
}
}
<pre>
Now back to the class where you want to use this extension.
After a dot on a string variable, you will see it in the intellisense:

string email = "tralala@something.com";
if (email.IsEmail())
{
//do something
}
That’s awesome, is that not ?
Indeed, when you put the magic word “this” in a static method insided a static class, VS will browse all the methods who take a string object in argument and will add it to intellisense.
How do I use it ?
As soon as I see that I will need a simple method for a particular type very often, I extend this type and add it to a homemade library( which contains all the extension methods I create). Of course put in your library only the standard object of the .NET framework otherwise you will get some compilation errors.
You are now able to use all the power provided by the intellisense.
For example, you have a new developer in your team. He does not need to search in the project where the functions are. He simply put a dot after his variable and he will see what is available. Moreover, if he is new with the .NET Framework, he will believe that it is included by default
.
related link : http://msdn.microsoft.com/en-us/library/bb383977.aspx
I expect my introduction to extension methods was clear, if not, do not hesitate to leave a comment…
As you know (or not), I am looking for a new challenge in London or in Brussels. So, if you know someone who could be interested by my services. Do not hesitate to give him my website’s URL. That would be awesome.
I decided to create a french blog, I notice that they are not a lot of interesting blogs in french who talks about agile, ddd, tdd,…
So, in place to express my little knowledge in a language who is not mine, I prefer to use my native language and improve the quality of my post.
Anyway, I will keep this blog for the technical parts (C#, ASP.NET,..).
For whom are interested by the dotnet Brussels community. I created a design for the future website. I know I am not a very good designer, also, generally, I do not care about design. But, as I am alone for this project, I have to do all by myself. So, here is the result :

In the future, I will use my CMS to update the content but as I do not have a server able to host a .NET website, I will certainly use wordpress in a first time…
Yesterday, I came back from the Montreal’s codecamp, that was a nice event, well organized.
Today, I was walking on the street of Montreal and thinking about why we do not have that kind of community in Belgium. A lot of people are motivated and always want to learn new stuff, so why do not we have that ? I mean, it is a good thing to exchange experiences and errors.
When I came back home, I went to a domain registrer and I saw that the domain dotnetbrussels.com was always free. The capital of europe does not have a dotnet community ? It seems not. After some searchs on google (bing is not yet available
), nothing. So I ordered the domain and I will put myself on work for this project.
If you are intersted to help me creating this community in Brussels, you are welcome ! I will keep you uptodate about this…
Here a url helper, maybe it can interests you :
public static class UrlHelperExtension
{
public static string Image(this UrlHelper helper, string fileName)
{
return helper.Content(string.Format("~/Content/Images/{0}",fileName));
}
public static string Stylesheet(this UrlHelper helper, string fileName)
{
return helper.Content(string.Format("~/Content/Css/{0}.css",fileName));
}
public static string Javascript(this UrlHelper helper, string fileName)
{
return helper.Content(string.Format("~/Content/Scripts/{0}.js", fileName));
}
}
And here is how I use it :
For CSS :
<link rel="stylesheet" type="text/css" href="<%= Url.Stylesheet("reset") %>" media="all" />
For javascript
<script src="<%= Url.Javascript("jquery-1.3.2.min") %>" type="text/javascript" language="javascript"></script>