Support modifying the value of primary or alternate key properties
See original GitHub issueIn the following location, an exception is raised when attempting to make modifications to a property that belongs to either a primary or alternate key (using the IsKey
extension method):
I have to ask: why restrict modifications on alternate keys, and why not use IsPrimaryKey
here instead?
Issue Analytics
- State:
- Created 8 years ago
- Reactions:19
- Comments:13 (5 by maintainers)
Top Results From Across the Web
Modifying an alternate key in a "disconnected" scenario ...
I had an alternate key on the Title field because I intended for it to be unique. ... the alternate key is back...
Read more >Keys - EF Core
By convention, an alternate key is introduced for you when you identify a property which isn't the primary key as the target of...
Read more >Work with alternate keys (Microsoft Dataverse) - Power Apps
This alternate key can be used to uniquely identify a row in Dataverse in place of the primary key. You must be able...
Read more >c# - The property is part of a key and so cannot be modified ...
To change the principal of an existing entity with an identifying foreign key, first delete the dependent and invoke 'SaveChanges', and then ...
Read more >c# - What's the real difference between Alternate Key and ...
The issue of mutable alternate keys is being tracked at Support modifying the value of alternate key properties, so please upvote to elevate ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@SidShetye Configuring it as a unique index in EF would be the most accurate approximation. If you don’t use EF to manage the schema you don’t even need to add the index, EF doesn’t use it.
If you do use migrations you can change the generated code to create a key instead.
@AndriySvyryd Like I mentioned, we share that database (don’t control the schema; not using migrations etc). We’re just trying to regenerate it’s closest approximation in the C# EF Core 3.0 model. Not having that limitation would allow for a more accurate approximation of the actual SQL database in EF Core.