Unable to determine the principal end of an association between the types Error

Error disebabkan adanya relasi one-to-one antar 2 tabel. Contoh skema:

Capture

Solusinya, tambahkan line berikut

[code language=”csharp”]
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
modelBuilder.Entity<Membership>().HasRequired(a => a.User).WithRequiredPrincipal(b => b.Membership);
}
[/code]

http://stackoverflow.com/questions/21849523/unable-to-determine-the-principal-end-of-an-association-between-the-types-error

Chandra Oemaryadi has written 244 articles

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>