Equivalent of EF Find Method and Local

Equivalent of EF Find Method and Local

Postby ValentinMTL » Tue 07 Oct 2014 15:03

I am considering to buy the dotConnect for MySQL and am trying to convert an existing project to it in VS2013 with EF6.

I am currently using the EF method DbSet<TEntity>.Find to find objects in a table by primary key.
The definition can be found here:

Is there an equivalent in dotConnect for MySQL?
devart seems to be using System.Data.Entity.Core.Objects.ObjectSet for tables, whereas the default EF uses System.Data.Entity.DbSet

Given this difference, Is there an equivalent of the Local property that allows the code to bypass a trip to the DB?

Thanks
ValentinMTL
 
Posts: 1
Joined: Tue 07 Oct 2014 14:09

Re: Equivalent of EF Find Method and Local

Postby Shalex » Mon 13 Oct 2014 10:43

You should change a code generation template: open *.edml model, navigate to Tools > Entity Developer > Model Explorer > the Templates mode, remove or disable the EntityObject template, add the DbContext template. Save your model to regenerate the code.

For more information, refer to
http://blog.devart.com/entity-developer-ef-code-first-dbcontext-template.html
http://blog.devart.com/entity-framework-6-support-for-oracle-mysql-postgresql-sqlite-and-salesforce.html
http://www.devart.com/dotconnect/mysql/docs/?efsupport.html

Does this help?
Shalex
Devart Team
 
Posts: 7470
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for MySQL