none
Edmx vs Dbml

    Question

  • I'm finding the Entity Framework hard work to deal with, particularly in terms of settings up data models with many tables and in making schema changes propogate through the data model and domain service.

    I believe an alternative to the edmx view of the world is to use a LinqToSqlDomainService instead, with a dbml model.  Since I am running off a Sql Server anyway, it seems this may offer less complexity, more transparency and easier maintenance.

    Are the entities projected in the SL client namespace in the same way?  Is there any particular reason why using LinqToSql would be a disadvantage to using LinqToEntities?

    Tuesday, December 01, 2009 7:22 PM

Answers

All replies

  • Shouldn't be any difference since they both generate classes that you would expose to the client via RIA services.

    Tuesday, December 01, 2009 7:40 PM
  • Yes, I see what you mean.  A new Domain Service seems equally happy to accept an EntityFramework or Linq To SQL model as its source. 

    So why would someone choose the EF model over a straight L2S? 

    It seems a lot more complex with its three-layer mapping mechanism, compared to the direct mapping to SQL items that the dbml uses, and harder to update.  I struck several mapping errors even when trying to implement a simple model, which I couldn't resolve, whereas my identical dbml model works fine.

    EF must have some terrific features that L2S is missing for people to perservere with it, but what are they? 

    Tuesday, December 01, 2009 8:48 PM
  • Hi Stephen,

    >EF must have some terrific features that L2S is missing for people to
    >perservere with it, but what are they?

    This isn't a direct answer to your question, but... 

    MS has indicated EF is their chosen solution going forward.  L2S and EF have enough overlap that it doesn't make sense to keep building them both out.  See: http://blogs.msdn.com/adonet/archive/2008/10/31/clarifying-the-message-on-l2s-futures.aspx

    But if you like L2S, keep using it.  It's not going away.  It just isn't going to receive new feature investment, while EF will.

    Alan Cobb
    www.alancobb.com/blog

    Tuesday, December 01, 2009 9:37 PM
  • Thanks Alan, interesting to read that article, particularly the heat being generated with some of the responses.

    I can understand how they feel,  I have found EF frustrating and cumbersome to work with, whereas so far L2S looks a lot easier to maintain and propogates SQL error messages clearly through to the client.

    Wednesday, December 02, 2009 4:56 PM
  • Thanks for keeping it straight forward.

    So far what I understood is Linq2SQL will be dead and if any nice features we can see them in EF in future releases?

    Thursday, May 03, 2012 9:27 AM