EF codefirst : Should I initialize navigation properties?

前端 未结 6 1600
醉梦人生
醉梦人生 2020-11-22 09:24

I had seen some books(e.g programming entity framework code first Julia Lerman) define their domain classes (POCO) with no initialization of the navigation properti

6条回答
  •  孤独总比滥情好
    2020-11-22 10:09

    I use the answer from this Why is my Entity Framework Code First proxy collection null and why can't I set it?

    Had problems with constructor initilization. Only reason I do this is to make test code easier. Making sure collection is never null saves me constantly initialising in tests etc

提交回复
热议问题