Using Entity Framework with MVC Storefront

Last post 06-20-2009 12:25 PM by jthanassis. 1 replies.

Sort Posts:

  • Using Entity Framework with MVC Storefront

    03-29-2009, 5:50 PM
    • Member
      point Member
    • smithym
    • Member since 09-06-2008, 7:05 PM
    • Posts 10

     Hi,

    can anyone give a helping hand, I been watching the videos for the mvc storefront and have create my own website using these techniques i.e. DDD, Repository pattern but i wish to use Entity Framework.

    In the Interfaces it returns IQueryable but with the entity framework i should return ObjectQuery instead? - I will be using LINQ.

    Also in the storedfront example it goes something like this IQueryable<Category> GetCategories();

    As in the mvc stored the Category class was a build entity class (standard class) but with the entity framework these classes are prebuilt in the object context - are they not?

    So i should need to build them.

    I am a little confused, if anyone has any helpful example or code it would be really helpful.

    As i say i have watched the videos from THe mvc storefront using linq2sql but really would like to use the entity framework.

    Any ideas?

    Thanks

    Smithy

  • Re: Using Entity Framework with MVC Storefront

    06-20-2009, 12:25 PM
    • Member
      5 point Member
    • jthanassis
    • Member since 12-07-2008, 12:21 PM
    • Posts 1

    Hi Smithy,

    Do you really want to switch to Entity Framework?

    I believe that using an ORM in software development is a good choice.

    Microsoft has done a great job in c# and lately in ASP.NET MVC but for an ORM solution is a couple of steps behind. 

    I really don't know whether Microsoft will one day offer a good ORM for .Net or not.

    Maybe in 2 years from now the impementation of Entity framework in .Net will be mature,stable and mainly light but not even Microsoft knows that right now.

    They decided to focus on L2E and the Entity Framework and leave behind L2S and Linq-to-SQL Classes (that's a good choice but shows that even big companies make bad decisions from time to time).

    Before switching to Entity Framework I would suggest to take a look at the following links:

    http://blog.domaindotnet.com/2006/09/09/objectrelational-tools-nhibernate-and-microsoft-adonet-entity-framework/

    http://blogs.hibernatingrhinos.com/nhibernate/archive/2008/11/26/linq-to-nhibernate.aspx

    http://blog.jagregory.com/2008/08/08/introducing-fluent-nhibernate/

     

    Finally, here are some usefull links to start with the Entity Framework: 

    http://naspinski.net/post/Getting-started-with-Linq-To-Entities.aspx

    http://stackoverflow.com/questions/589906/how-to-move-from-linq-2-sql-to-linq-2-entities

    (stackoverflow is always a great place to find usefull information)

    Currently I'm developing a clone of an existing CMS (written in classic ASP) using c#,ASP.NET MVC and L2S.

    In the near future i will keep using c# and ASP.NET MVC but I will focus on NHibernate unless Microsoft has something interesting to show me. Right now there is no such thing. I really like Linq and I expect that Linq-to-NHibernate support will be much more mature in the near future.

    The only reason I replied to your initial question is to remind you that you should never follow a technology before looking around for a beter alternative and right now I strongly believe that the Entity Framework implementation for .NET is not the best solution if we really need to use an ORM in our software.

    thanassis

Page 1 of 1 (2 items)