Friday, March 05, 2010

northwest

Just a shout to let you all know of NW-MTUG's next session on 10th March, it's on Using ASP.NET MVC 2 - Introduction to MVC & What's New and will be presented by Martha Rotter. Check out NW-MTUG's site for all the details.

posted on Friday, March 05, 2010 10:12:57 PM (GMT Standard Time, UTC+00:00)  #    Add Comment | Comments [0]
 Thursday, October 29, 2009

I've been doing some work with the Unity IoC container recently and had to configure some generic types so I thought I'd post some of the examples here so that I'd have some to refer back to more than anything else a blog post tends to be less likely to get lost that an old post-it note.

Xml config to configure mapping for a specific generic type, note the use of [[]] to define the generic type. Inside the square brackets you specify type name and the assembly containing the type. In both example `1 signifies the generic parameter:

<type type="Data.Repository.IRepository`1[[Poco.Address, Poco]], Data.Repository"
      mapTo="Data.Repository.LinqRepository`1[[Poco.Address, Poco]], Data.Repository">
  <lifetime type="singleton"></lifetime>
</type>

Xml config to configure open generic type mapping:

<typeAlias alias="IRepository`1"            
           type="Questern.ActiveOrderManagementSystem.Data.Repository.IRepository`1, 
Questern.ActiveOrderManagementSystem.Data.Repository
" /> <type type="IRepository`1" mapTo="Questern.ActiveOrderManagementSystem.Data.Repository.LinqRepository`1,
Questern.ActiveOrderManagementSystem.Data.Repository
"> <lifetime type="singleton" /> </type>

 

Thanks to Marceli for helping out with this!!

posted on Thursday, October 29, 2009 7:52:26 PM (GMT Standard Time, UTC+00:00)  #    Add Comment | Comments [1]
 Thursday, April 30, 2009

I seen some very good posts on this that include project and reg files necessary to set this up, however I run Vista 64 and found that the reg files didn't work for me. So after a poke around the registry I came up with the following two reg files that have done the trick for me. One for Visual Basic and one for C#.

If you want a complete description on how to register a custom testing framework with Visual Studio for use with ASP.Net MVC check out either of these links.

This zip file contains registry keys for C# and VB.NET:

RegistryFiles.zip (.92 KB)
posted on Thursday, April 30, 2009 6:51:38 PM (GMT Standard Time, UTC+00:00)  #    Add Comment | Comments [1]