support for EF 2.0 and self tracking entities

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
Micha_
Posts: 10
Joined: Mon 18 Jan 2010 18:58

support for EF 2.0 and self tracking entities

Post by Micha_ » Fri 21 May 2010 12:42

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

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Fri 21 May 2010 15:53

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.

Micha_
Posts: 10
Joined: Mon 18 Jan 2010 18:58

Post by Micha_ » Tue 25 May 2010 07:57

GREAT!!! It works. Thank you!
Looking forward to future builds with direct support.

[email protected]
Posts: 13
Joined: Sun 15 Aug 2010 11:08

Post by [email protected] » 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

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Mon 16 Aug 2010 08:52

Taher, we have replied to you here.

object
Posts: 91
Joined: Tue 26 Oct 2010 08:29

Post by object » Thu 11 Nov 2010 13:07

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?

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Thu 11 Nov 2010 13:48

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).

Post Reply