views:

254

answers:

1

We are about to start a project which involves using a Sql Server 2005 with lakhs of records. In the past I have used NHibernate with good results. But now I am evaluating Linq to entity for the data access. I have these questions on L2E,

  1. How good is the caching that the L2E does compared to NHibernate (basically how is the performance)?
  2. How easy is it to work with single .edmx file (We might have multiple developers working on these files simultaneously)? In case we decide to split the file, how easy is it to do and what are the disadvantages?
  3. How easy is it to mock the generated classes?
  4. Does it support MS Access?
+2  A: 
  1. Linq2Entities does not do any implicit caching. When you run the query, it converts the Linq to a SQL query, executes it and returns the result. It's that simple.

  2. You cannot split your model in more than one EDMX file. Well, you can, but you'll lose the relationships between the entities. You could do this if your database contains several entity groups that aren't interdependent.

  3. Not very. We have a system that mocked out the ObjectContext to intercept calls to it (we use an interface to do entity access, which maps to the real ObjectContext at runtime and to a mock ObjectContext at unittest time.

  4. It does, but you'll have to create your entities yourself (you cannot generate them from the DB).

Inferis
Regarding mocking, did train wreck way (objectContext.Entity.Something()) of coding hurt you while writing tests
Nazgul
Yes it does have caching. All entity results queried on a context are cached within that context. If you keep your context alive you'll have caching. The trick is you have to use DataContext.GetObjectByKey() to retrieve a cached object.
AZ
Hence my "not implicit".
Inferis
@Inferis y, but its the text you follow it with that is a bit misleading (not that simple after all) ;) @AZ reusing datacontext between requests is not a good idea, well, specially in web apps.+1 good answer :)
eglasius