This question is locked. New answers and comments are not allowed.
I'm trying to build my first openaccess orm application. I have downloaded and installed latest version of ORM Express.
Then I have created new solution in Visual Studio 2010, and created class library project.
I then added domain model, pointing to "empty" SQL 2008 EXPRESS database.
In visual designer, I've added class called BaseEntity with just one property (ID: Int32)
And then added class called User with properties (Username:string, Password: string, Email: string)
I have added Inheritance between these 2 classes. Then selected BaseEntity class and specified Horizontal inheritance strategy in Inheritance mapping window. When I trying to save my model, it give me different errors:
1. If I set Identity to true for BaseEntity class, ID property, it give me error that horizontal base class cant have identity
2. The only way I can add identity to my User class, by adding new property ID to User class, which hides base ID property. This resolved all errors, but when I generate script using Update Database from Model, table User contains 2 ID properties, which is wrong.
Can you please explain correct way to use horizontal inheritance. Is it possible in OpenAccess to define base class for all entities with ID property?
Thanks
Then I have created new solution in Visual Studio 2010, and created class library project.
I then added domain model, pointing to "empty" SQL 2008 EXPRESS database.
In visual designer, I've added class called BaseEntity with just one property (ID: Int32)
And then added class called User with properties (Username:string, Password: string, Email: string)
I have added Inheritance between these 2 classes. Then selected BaseEntity class and specified Horizontal inheritance strategy in Inheritance mapping window. When I trying to save my model, it give me different errors:
1. If I set Identity to true for BaseEntity class, ID property, it give me error that horizontal base class cant have identity
2. The only way I can add identity to my User class, by adding new property ID to User class, which hides base ID property. This resolved all errors, but when I generate script using Update Database from Model, table User contains 2 ID properties, which is wrong.
Can you please explain correct way to use horizontal inheritance. Is it possible in OpenAccess to define base class for all entities with ID property?
Thanks