Why is property defined a second time with T4T?

Nov 21, 2011 at 7:10 AM

I have just created a new project, the NuGet way, and added the Model and T4 Templates item as per the manual; section: "2. Creating a Model project".

I get: The type 'EFMS.Util.Model.norms_prototype' already contains a definition for 'norms_prototype_id'

The property is defined both in the norms_prototype.cs file, generated under the Model.Types.tt, as well as in the Model.Designer.cs file.

What am I doing wrong?


PS Of course, it happens with all the properties on all my entities.

Nov 21, 2011 at 8:10 AM

If you add the Naked Objects T4 template to a project, you need to switch off the default code generator associated with the .edmx file  -  otherwise all the [partial classes (not just the properties) will be generated twice.  Select the properties on the .edmx file and clear the Custom Tool property.

Nov 21, 2011 at 8:26 AM
Ok will do.
Is there mention of this in the manual?

Thank you much.