ASP.NET MVC from scratch

07 Jun 2009 Yesterday I thought that it would be a good idea to check out ASP.NET MVC (MVC) on my “on-the-edge” rig with Visual Studio 2010 running on Windows 7. It shouldn’t have surprised me then, that ASP.NET MVC support is currently unavailable for this combination. According to Phil Haack it was...

Fashion of the week - Building with Rake

01 Jun 2009 Here & There I have been seeing people using Ruby’s build system rake in their .NET open source projects instead of NAnt or MSBuild. I don’t really feel like commenting this fact here, but it is slightly annoying that people expect us to know ruby and do not write a...

How much does Linq.Take take?

17 Apr 2009 I wasn’t 100% certain how much the “Take” would take from a list with less elements than the number you want to take. It probably says in the docs, but let me assure you that this test succeeds: [Test] public void TakeTakesAsMuchAsThereIs() { string[] stuff = {"hi"}; var l =...

Scary StructureMap configuration expressions Pt.1

07 Apr 2009 “Most scary StructureMap Configuration Expression”™ so far… ForRequestedType() .InterceptConstructionWith(wcfCachePolicy) .AddInstances(instanceExpression => instanceExpression.Conditional( cond => { cond.TheDefault.Is.ConstructedBy( ctx => ctx.GetInstance() .OpenSession( new IsisNHInterceptor(ctx.GetInstance()))); cond.If(ctx => ctx.ParentType.Name.Contains("ReadOnly")).ThenIt.Is. ConstructedBy( ctx =>ctx.GetInstance().OpenSession()); })); </csharp> The idea: In order to correctly talk to a decidedly legacy-i Database correct, write operations need to set a number...

Comfortable command line argument parsing

27 Mar 2009 Once in a while you may want to write a command line tool which may have to accept commad line arguments. In comes a nice little bit of source code that is part of the great output of the Mono project. Documentation is available here and the source code can...