问题描述
我正在尝试使用Entity Framework Core 1.0 RC 1更新实体及其相关的子实体,其中实体与DbContext分离。我以前使用的解决方案类似于中所述的解决方案。
但是,似乎我们不再能够使用Entity Framework 7执行以下操作:
DbContext.Entry(existingPhoneNumber).CurrentValues.SetValues();
Visual Studio抱怨:
我认为表示尚未(尚未?)针对EF Core 1.0实施?除了手动更新属性外,还有其他解决方案吗?
您已经注意到,该API尚未在EF核心。请参阅以下工作项: https://github.com/aspnet/EntityFramework/issues/1200
I'm attempting to update an entity and its related child entities using Entity Framework Core 1.0 RC 1, where the entities are detached from DbContext. I've done this previously using a solution similar to the one described in this answer.
However, it seems that we are no longer able to do the following using Entity Framework 7:
DbContext.Entry(existingPhoneNumber).CurrentValues.SetValues();
Visual Studio complains that:
I presume this means that this has not (yet?) been implemented for EF Core 1.0? Apart from manually updating the properties, is there any other solution?
As you have noticed, this API is not implemented yet in EF Core. See this work item: https://github.com/aspnet/EntityFramework/issues/1200
这篇关于实体框架核心1.0 CurrentValues.SetValues()不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!