About Hasmukh patel

My Photo
Harrow, London, United Kingdom
Dot-Net developer with expertise in Web, WPF, Win-form applications. Have worked on Asp.net,mvc , WPF and Win-forms projects in c#.net language having Sql-Server/Oracle as database with service oriented architecture using test driven development. Having complete knowledge of SDLC and have successfully worked and implemented it on projects.

MVC Tips and Tricks


Setting up Dependency Resolver with MVC 3 and 4

In order to setup DependencyResolver, you have to create a class which should implementation of IDependencyResolver Interface. First you need a Dependency Injection Containers (IOC) like Unity, Castle Windsor, Ninject, StructureMap, Spring.NET, Autofac, Puzzle.NFactory, PicoContainer.NET, LinFu  or you can create your own IOC based on .Net Reflection. 
 
More details available with an example on my blog post

Custom Authentication


In order to implement custom authentication, application’s forms cookie need to override with custom user object with implementation of IPrincipal and IIdentity interfaces.
When application request for authenticate user then system fire an event of Application object.  
Implement authentication in Global.asax.cs
Add Application_AuthenticateRequest event into the Global.asax with AuthenticationTicket extension method.



More details available with an example on my blog post

Some other important blog posts about MVC 2


 
More blog posts available about MVC on my main page of the blog.

No comments :