EF Code First Parent-Child insertions with identity columns

后端 未结 2 1514
离开以前
离开以前 2020-12-13 10:37

i have the following model.

class Parent
{
    int ParentId (identity column) { get; set; }
    string ParentName { get; set; }
    virtual ICollection

        
2条回答
  •  盖世英雄少女心
    2020-12-13 11:02

    For an example of how to do this, see the new EF Code First MVC tutorial series. The 6th one in the series has an example of this. The first one in the series of 10 is here: http://www.asp.net/entity-framework/tutorials/creating-an-entity-framework-data-model-for-an-asp-net-mvc-application

提交回复
热议问题