Deat friends
Fluent Nhibernate is not setting the value of foriegn key in children
table, is there anyone to write the reason ?
My code:
public class StoreMapping : ClassMap<StoreModel>
{
public AcademicBooksMapping()
{
Table("Store");
Id(u => u.Id);
Map(u => u.name).Nullable();
HasMany(x =>
x.Books).Not.KeyNullable().KeyColumn("StoreId").Inverse().Cascade.All().Not.LazyLoad();
}
}
public class BooksMapping : ClassMap<BookModel>
{
public BooksMapping()
{
Table("Book");
Id(u => u.Id);
Map(u => u.name).Nullable();
References(x =>
x.Profile).Column("StoreId").Cascade.SaveUpdate().Not.LazyLoad();
}
}
StoreId is null en every save
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/nhusers/b10d6f51-b54e-4c20-a815-91fde26bf6fan%40googlegroups.com.