views:

63

answers:

2

I am a newbie to ASP.net & MVC 2, and have understood the basic concepts of how views, routes and controllers are implemented in it. Having great trouble with the MVC 2 "Models" though because I have always avoided ORM's.

Please point me to some good ASP.net MVC web application tutorials that use ADO.net Entity Framework with many tables. In particular, I want to understand repository pattern better and how to insert / update data into related multiple tables. (The NerdDinner tutorial was unsatisfactory).

(P.S: Prefer tutorials in C#, but VB is ok too).

A: 

That's not a question about MVC, but about ORM's in general. Look at "LINQ in action" from Manning Publications, to learn more deeply about LINQ, or read somewhere else about nHibernate.

A simple tutorial just won't do, because the subject is too large. Even a medium book didn't contain all of its possibilities (but MSDN and this forum has the rest)

Alexander
I prefer to see things in action first. Helps me understand it better. Also, I won't be using LINQ but Entity SQL.
Sam
Entity Framework IS LINQ. That book I wrote about explains this subject quite well. Although I do understand your concern and how my answer to your question can be partial at best, because I am facing a similar situation to yours.
Alexander
I am confused now - from what I gathered they aren't the same. This article - http://msdn.microsoft.com/en-us/library/cc161164.aspx - explains it thus - "LINQ to SQL is an object-relational mapping (ORM) framework ... EF is a framework built on ADO.net, one of whose service being the ORM"
Sam
EF is NOT LINQ. EF is an ORM that has a LINQ provider so one can write LINQ queries against EF entities and have them intelligently converted into SQL that runs directly against the database (rather than against in memory objects.
qstarin
Thanks for clarifying that, qstarin. That was my understanding too.
Sam
and that's all under LINQ namespaces, and is very well explained in the book about LINQ.
Alexander
+2  A: 

There is probably no example with a lot of tables because every author shows just a concept but I think that the following examples are more complex (with more layers) than NerdDinner.

http://thedatafarm.com/blog/data-access/agile-entity-framework-4-repository-part-1-model-and-poco-classes/

http://www.codeproject.com/KB/aspnet/ASP_NET_MVC_WITH_EF.aspx

http://code.msdn.microsoft.com/ef4

http://kigg.codeplex.com/

http://kandaalpha.codeplex.com/

http://1code.codeplex.com/

Worth to take a look at

http://nsk.codeplex.com/

http://codecampserver.codeplex.com/

http://mvctimeplanner.codeplex.com/

Hope it helps.

nubm
Thanks for the links. Going through it ...
Sam