Pages

Friday, November 14, 2008

Using Linq with MVC

At ASP.Net site, there is a video that shows how to use Linq as a model inside a MVC framework. It is useful to see it also as a very basic and simple introduction to using Linq generally.

It shows different types of queries – query syntax and method syntax. Query syntax is similar to SQL query language while method syntax uses Lambda expressions.

The recommended way of implementing a model is to use Repository pattern.

Also, demonstrated is the way to use Constructor Dependency Injection pattern to allow for easier testability of the controller classes.

No comments: