I was put on this project to perform an upgrade for the newer telerik version.
One of the issues i have been trying with no success, is upgrading the data modeling to fluent.
I followed, the the steps i found at http://www.telerik.com/blogs/benefits-of-code-only-mapping-and-how-to-get-them, and i was able to generate and import the classes for code mapping. However, i am getting the exception "Telerik.OpenAccess.RT.sql.SQLException:
Invalid column name 'ID2'."
It seems, the system is trying to do a select to the DB with that ID2 field, that does not exist.
This is the query that i found in the exception:
[Acronym] AS COL1, [AddressID] AS COL2, [AddressID] AS COL3, [BI] AS COL4,
[BirthDate] AS COL5, [Board] AS COL6,
AS COL7, [Department] AS COL8, [Email] AS COL9, [Name] AS COL10, [Nationality]
AS COL11, [Nif] AS COL12,
AS COL13, [Phone] AS COL14, [PlaceOfBirth] AS COL15, [ID2] AS COL16,
[QualificationDetail] AS COL17, [QualificationID] AS COL18 FROM [ET_Person]
WHERE [ID] = ?
I don't understand where that ID2 field came from, and i don't know why there isn't an ID field int the select statement.
There is an association between users(Utilizadores) and Person, the association in the code is the following:
configuration.HasAssociation(x => x.Utilizadors).HasFieldName("utilizadors1").WithOpposite(x => x.Person).HasConstraint((y, x) => x.PersonID == y.ID ).IsManaged().IsDependent().WithDataAccessKind(DataAccessKind.ReadWrite);
and for Utilizadores,
configuration.HasAssociation(x => x.Person).HasFieldName("person1").WithOpposite(x => x.Utilizadors).HasConstraint((x, y) => x.PersonID == y.ID ).IsManaged().IsRequired().WithDataAccessKind(DataAccessKind.ReadWrite);
I would appreciate any help in this matter.
If you need any more information, please let me know.