navigation property provide a way to navigate the association between 2 entities.
public virtual ICollection<Course> Courses { get; set; }
public virtual OfficeAssignment OfficeAssignment { get; set; }
the "virtual" keyword indicates that the navigation property can take advantage of an EF-feature called "lazy loading"
and if one property contains mutiple entities,its type must implement the ICollection<T> interface.
For example,IList<T> qualifies but no IEnumerable<T> because IEnumerable<T> doesn't implement Add method.
navigation property provide a way to navigate the association between 2 entities.
the "virtual" keyword indicates that the navigation property can take advantage of an EF-feature called "lazy loading"
and if one property contains mutiple entities,its type must implement the
ICollection<T>
interface. For example,IList<T>
qualifies but noIEnumerable<T>
becauseIEnumerable<T>
doesn't implement Add method.