Unmapped Class Member error - One-To-Many Relationship
Posted: Wed 21 Dec 2011 18:30
Hi,
We have the following entities:
-Account:
*Id - Guid
*Data - String
-Logins:
*Id - Guid
*AccountId - Guid
*Sucess - bool
It's not strctly like this but it's enough for explanation of the error. I'm creating like this (Accounts is abstract for several entities):
Create var of accountType (it insert alone correctly and same for login, but when inserting then in same context it throws errors).
var login = new Login() { Id = Guid.NewGuid(), Time = DateTime.Now, IP = "0.0.0.0" };
login.Account = accountType1;
context.Logins.InsertOnSubmit(login);
context.SubmitChanges();
It throws error Unmapped classmember Account, Logins.
We have the following entities:
-Account:
*Id - Guid
*Data - String
-Logins:
*Id - Guid
*AccountId - Guid
*Sucess - bool
It's not strctly like this but it's enough for explanation of the error. I'm creating like this (Accounts is abstract for several entities):
Create var of accountType (it insert alone correctly and same for login, but when inserting then in same context it throws errors).
var login = new Login() { Id = Guid.NewGuid(), Time = DateTime.Now, IP = "0.0.0.0" };
login.Account = accountType1;
context.Logins.InsertOnSubmit(login);
context.SubmitChanges();
It throws error Unmapped classmember Account, Logins.