Entity Framework 4.1 Codefirst: “Given multiplicity constraints” error when deleting one-to-many children

前端 未结 2 668
星月不相逢
星月不相逢 2021-01-18 01:36

I have the following classes in Entity Framework 4.1 (the classes have been pruned to keep the code readable)

public class MetaInformation
{         


        
2条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-18 02:29

    Echoing above comment, below code would solve your problem

    DataContext.Dao.Db.MetaInformations.RemoveRange(workingMachine.MetaInformations);

提交回复
热议问题