Inheritance Errors in 4.1

Jun 3, 2011 at 7:05 AM


      I am using nHydrate v4.1.0.198 with VS.NET 2010 Ultimate. My nHydrate project is for SQL2008 and uses UTC time.

I have one ParentTable with the following fields

ID (int, PrimaryKey, Database Identity, Unique, Searchable, Indexed, AllowNull=False)
Property1 (nvarchar(50),,,,,,True)

The ChildTable - which inherits the elements of ParentTable (ParentTable option set) - has the following fields

ID (int, PrimaryKey,,Unique,Searchable,Indexed,false)
Property1 (inherited)
Property2 (nvarchar(50),,,,,,True)

On ParentTable an enforced relationship is set between ParentTable.ID and ChildTable.ID. The model validates without errors.

After code generation (DAL, DAL Proxy, DTO, DB Installer, Server IOC Extensions, Service Interfaces), it fails to build the solution.

The first project (DAL) presents the following errors:

Error	1	The type 'MyCompany.MyProject.Business.SelectCommands.ChildTableSelectByID' already contains a definition for 'mID'	C:\Temp\Solution1\MyCompany.MyProject\Business\SelectCommands\ChildTable.Generated.cs	287	15	MyCompany.MyProject

This example was isolated from a larger nHydrate project I am working on after finding out that generated code would not compile if inheritance is used.

Any ideas what might be wrong?

Thank you very much in advance.

Jun 4, 2011 at 2:16 PM

I have used the model you posted in the Issue Tracker and I do not see this issue. I have verified and resolved another issue but I do not see this particular issue. Are you using a difference model? If so, could you please send it to

Jun 4, 2011 at 2:57 PM

I've sent you a complete VS.NET solution (with the respective model) to demonstrate this issue.

Jun 5, 2011 at 12:36 PM

I received you model and these issues were resolved. This fix will be in the next release.