tracker-enabled-dbcontext icon indicating copy to clipboard operation
tracker-enabled-dbcontext copied to clipboard

Raise exception when an entity has no key, and only has a foreign key to it's parent

Open husseinjahan opened this issue 8 years ago • 1 comments

hi dear @bilal-fazlani

I was faced with a problem.

in this case I get an exceprion:

public class Student
{
         public int Id{get; set;}
}
public class StudentAddress
{
       [Key]
       public int StudentId{get;set;}
       public string Address{get;set;}
}

when I want to save StudentAddress, because can't find primary key

husseinjahan avatar Aug 30 '16 13:08 husseinjahan

What is the exception?

stacktrace ?

bilal-fazlani avatar Sep 01 '16 08:09 bilal-fazlani