Cannot update identity column 'Index'. EF Core

.net ef-code-first entity-framework-core

Question

Like the title says, I'm getting a error message while I try to update a entity in EF Core.

Here's the entity that I'm trying to update. Pay attention to the Index property tha's decorated with the Databasegenerated attribute. enter image description here

I tried to decorate wthe property so a value would only be generated when a new entity is added, but without success.

enter image description here

Regarding to this link: http://ef.readthedocs.io/en/latest/modeling/generated-properties.html#value-generated-on-add

And finally the update method looks like this:

enter image description here

What am I doing wrong here?

1
0
9/11/2017 6:40:51 AM

Popular Answer

For those who run into this, it was a bug with EF Core 1.0. See https://github.com/aspnet/EntityFramework/issues/6426.

It has been marked as fixed in EF Core 1.2.

2
3/8/2017 3:50:56 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow