views:

85

answers:

1

I'm trying to create a solution with layered architecture and self tracking entities. I used the Entity Framework C# POCO Entity Generator i download from Extensions Online Gallery. I separated the context.tt with the entities.tt on they're own class libraries. Mapped the entities.tt to the Model. Now i need to make these classes inherit from a base class i created in another class library. Unfortunately i know nothing about changing the T4 template. Can someone help me on this problem to continue?

Thank you.

+1  A: 

In your tt file search for

foreach (EntityType entity in ItemCollection.GetItems<EntityType>().OrderBy(e => e.Name))

And then look for a line that has

<#=Accessibility.ForType(entity)#> <#=code.SpaceAfter(code.AbstractOption(entity))#>partial class <#=code.Escape(entity)#><#=code.StringBefore(" : ", code.Escape(entity.BaseType))#>

Then add your interface to the end of it.

Nix
Thank you, can you provide some help on adding namespaces on each entity and DataContract DataMember attributes?
I would need to know what you are trying to accomplish?Create a new question? or update the above.
Nix