This question is locked. New answers and comments are not allowed.
Hi,
(ORM v2012.1.301.2)
Following the documentation here:
http://www.telerik.com/help/openaccess-orm/openaccess-tasks-define-model-inheritance-mixed-mapping.html
This generates errors (2) and the code generation (1) is wrong:
.... ^^ VB really wants the "
... Also I get 6 other errors
1) Interface 'ICat' is not implemented by this class.
2) The IdentityType of the 'ConsoleApplication2.Cat' is not compatible with the number of its identity fields.
3) The IdentityType of the 'ConsoleApplication2.Dog' is not compatible with the number of its identity fields.
4) The IdentityType of the 'ConsoleApplication2.Pet' is not compatible with the number of its identity fields.
5) The IdentityType of the 'ConsoleApplication2.Rottweiler' is not compatible with the number of its identity fields.
6) The IdentityType of the 'ConsoleApplication2.WienerDog' is not compatible with the number of its identity fields.
What I would like to have is this something like this:
Contact
ContactId: Int32 (pk, autonr)
Name: String
Type: Int32
Employee
EmployeeId: Int32 (pk, autonr)
ContactId: Int32 (fk > Contact.ContactID)
Phone: String
So: With my model I want to do this:
When I do this ^ the model automatically creates a Contact record with ContactId=1 (autonr) AND creates a Employee record with EmployeeId=1 (autonr) and ContactId=1 (bind to contact fk) ...
Or am I expecting to much? :-)
Thanks,
Erik
(ORM v2012.1.301.2)
Following the documentation here:
http://www.telerik.com/help/openaccess-orm/openaccess-tasks-define-model-inheritance-mixed-mapping.html
This generates errors (2) and the code generation (1) is wrong:
....End ClassPublic Partial Class Cat Inherits Pet Implements ICat Private _breed As String Public Overridable Property Breed As String....Implements ICat" on the next line you know...... Also I get 6 other errors
1) Interface 'ICat' is not implemented by this class.
2) The IdentityType of the 'ConsoleApplication2.Cat' is not compatible with the number of its identity fields.
3) The IdentityType of the 'ConsoleApplication2.Dog' is not compatible with the number of its identity fields.
4) The IdentityType of the 'ConsoleApplication2.Pet' is not compatible with the number of its identity fields.
5) The IdentityType of the 'ConsoleApplication2.Rottweiler' is not compatible with the number of its identity fields.
6) The IdentityType of the 'ConsoleApplication2.WienerDog' is not compatible with the number of its identity fields.
Contact
ContactId: Int32 (pk, autonr)
Name: String
Type: Int32
Employee
EmployeeId: Int32 (pk, autonr)
ContactId: Int32 (fk > Contact.ContactID)
Phone: String
So: With my model I want to do this:
Using dbContext As New EntitiesModel() Dim Emp As New Employee With Emp .Name = "Erik" .Type = 1 .Phone = "123456789" End With dbContext.Add(cat) dbContext.SaveChanges()End UsingWhen I do this ^ the model automatically creates a Contact record with ContactId=1 (autonr) AND creates a Employee record with EmployeeId=1 (autonr) and ContactId=1 (bind to contact fk) ...
Or am I expecting to much? :-)
Thanks,
Erik