After Thought

Archive for July 2009

Setting up FubuMVC application on IIS7

leave a comment »

Recently my colleague Weston Binford was trying to set up a FubuMvc application to do a comparison analysis with Asp.net Mvc. He had some issues with running FubuMvcSampleApplication FubuMvc under IIS7. After much debugging he found out that UrlRoutingModule and UrlRoutingHandler must be added under system.webServer tag.

<system.webServer>
 <modules>
 <remove name="UrlRoutingModule" />
 <add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
 </modules>
 <handlers>
 <remove name="UrlRoutingHandler" />
 <add name="UrlRoutingHandler" preCondition="integratedMode" verb="*" path="UrlRouting.axd" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
 </handlers>
</system.webServer>
Advertisements

Written by shashankshetty

July 29, 2009 at 10:32 am

Posted in C#, Fubu Mvc, FubuMvc, Uncategorized

Tagged with , ,

Now you can insert records into Excel using ExcelMapper

leave a comment »

You can now use ExcelMapper to insert records into Excel as well. Continuing with the same User example, we can insert a User (John Doe) into Excel using ExcelMapper.

ExcelMapper.SetUp();
IRepository repository = ServiceLocator.Current.GetInstance<IRepository>();

List<User> users = new List<User>
{
   new User
   {
       Id = 1,
       LastName = "Doe",
       FirstName = "John
       DateOfBirth  = Convert.ToDateTime("2/2/1990")
   }
};
repository.Put<User>(users);

Note that User DTO was generated using BuildDTOsFromExcel.exe.

repository.Put<User>(User) saves the Users List into Excel. Since we don’t have the concept of unique keys yet, it can only insert and not update.

Written by shashankshetty

July 27, 2009 at 10:11 am

Posted in C#, ExcelMapper, Microsoft Excel

Tagged with , , ,