更新时间:2021-07-21 07:58:28
您Assosiactions列表需要将项目添加到它之前被实例化。
Your Assosiactions List needs to be instantiated before adding items to it.
***做法是从构造方法中做到这一点。
Best practice is to do this from within the constructor.
public class KeyDate
{
...
public virtual ICollection<Association> Associations { get; set; }
public KeyDate()
{
Associations = new List<Association>()
}
}