Does Entity Framework support circular references?

前端 未结 4 1979
感动是毒
感动是毒 2021-01-04 06:42

I have two entities in parent/child relationship. In addition, parent contains a reference to a \"main\" child, so the simplified model looks like this:

clas         


        
4条回答
  •  说谎
    说谎 (楼主)
    2021-01-04 06:48

    No, it's supported. Try it with a GUID key or an assignable sequence. The error means exactly what it says it does: The EF can't figure out how to do this in one step. You can do it in two steps, though (two calls to SaveChanges()).

提交回复
热议问题