Unmapped Class Member error - One-To-Many Relationship

Discussion of open issues, suggestions and bugs regarding LinqConnect – Devart's LINQ to SQL compatible ORM
Post Reply
bichuete
Posts: 3
Joined: Wed 21 Dec 2011 18:16
Location: Brasil

Unmapped Class Member error - One-To-Many Relationship

Post by bichuete » 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.

StanislavK
Devart Team
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Post by StanislavK » Thu 22 Dec 2011 14:58

Generally, this exception specifies that the mapping provided for your DataContext class has no information about the Account.Logins navigation property. Could you please specify the following:
- the definitions of the Account and Login classes;
- the mapping mode (attribute, file, or fluent) you are using for them;
- the stack trace of the exception.
If possible, please send us a model with which the problem can be reproduced.

Post Reply