Page 1 of 1
support for EF 2.0 and self tracking entities
Posted: Fri 21 May 2010 12:42
by Micha_
We want to use the new version of EF and its support for self tracking entities. We use the devart dotconnect provider for oracle. With the Microsoft Entity Designer we have success creating an Entity Model and adding the self tracking Entity generator. But the Devart Entity Designer only produces an EDMX/EDML file with the header
So the self tracking entities templates are not working.
Microsoft Entity Designer produces an EDMX file with Version="2.0".
Will there support for version 2.0 in a new version of the devart entity designer?
Thanks, Michael
Posted: Fri 21 May 2010 15:53
by AndreyR
Please make sure that you have set the Entity Framework version property to ".Net Framework 4.0".
We plan to add support for the Self-Tracking Entities in one of the future builds.
At the moment you can use the following workaround.
Go to the
Code: Select all
%Program Files%\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Microsoft\Entity Framework Tools\Templates\Includes\EF.Utility.CS.ttinclude
and change
Code: Select all
if (extension.Equals(".edmx", StringComparison.InvariantCultureIgnoreCase))
to
Code: Select all
if (extension.Equals(".edmx", StringComparison.InvariantCultureIgnoreCase) || extension.Equals(".edml", StringComparison.InvariantCultureIgnoreCase))
and save the file.
In case you are using VB.NET you should perform these operations with the EF.Utility.VB.ttinclude file.
Posted: Tue 25 May 2010 07:57
by Micha_
GREAT!!! It works. Thank you!
Looking forward to future builds with direct support.
Posted: Sun 15 Aug 2010 11:12
PLZ I need your help, how you can use the self tracking template
step by step if you can plz
Posted: Mon 16 Aug 2010 08:52
by AndreyR
Taher, we have replied to you
here.
Posted: Thu 11 Nov 2010 13:07
by object
Andrey,
I updated EF.Utility.CS.ttinclude as you suggested, so now it accepts EDML extension in addition to EDMX. But I can't figure out how can I trigger it for a Devart entity model. If I generate an ADO.NET Entity Model, then I can right click in a model and select "Add Code Generation Item". But this option is not available if I select an EF model generated with Devart Entity Developer. How can I then configure a T4 template for Devart entity model?
Posted: Thu 11 Nov 2010 13:48
by AndreyR
Add a new ADO.NET POCO Entity Generator (or ADO.NET Self-Tracking Entity Generator) to your project, and then replace $edmxInputFile$ with the name of your .edml file in both code generation templates (Model.Context.tt and Model.tt).