Not able to figure out why i get the error "Unable to cast object of type Generic List to type 'NHibernate.Collection.IPersistentCollection'" #497
Unanswered
aswinfrancis
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
My parent class:
public class SomeData
Child class:
SomeData has One-To-Many relation with SomeUser. Mapping is as below:
public class SomeDataMapping : NHibernateClassMapping
{
public SomeDataMapping()
{
References(x => x.Schedule).LazyLoad();
HasMany(x => x.SomeUser ).Inverse().Cascade.All()
.KeyColumn("Schedule_Id").Table("SomeUsers");
}
AssignedTo_Id").Class().Not.Nullable();
Table("SomeUsers");
}
}
}
schedule.SomeData.SomeUsers = viewDto.AssignedUserIds.Select(id => new SomeUser
{
SomeData = schedule.SomeData,
AssignedTo = userRepo.FindBy(id)
});
Beta Was this translation helpful? Give feedback.
All reactions