Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Entity Framework Core 1.0 CurrentValues.SetValues() does not exist

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:

EntityEntry does not contain a definition for 'CurrentValues' etc...

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?

like image 305
Blake Mumford Avatar asked Aug 02 '26 18:08

Blake Mumford


1 Answers

As you have noticed, this API is not implemented yet in EF Core. See this work item: https://github.com/aspnet/EntityFramework/issues/1200

like image 126
natemcmaster Avatar answered Aug 04 '26 09:08

natemcmaster



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!