Click here to Skip to main content
15,881,600 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
An exception of type 'System.InvalidOperationException' occurred in EntityFramework.dll but was not handled in user code

Additional information: The key field 'Id' cannot have a value of null. A non-null value is required for the key fields defined on type 'Invite'.
Posted

1 solution

Would be nice if you would post the code of your entity with the ef attributes. But you probably added the DatabaseGenerationOption.None on the Id, meaning it won't be created automatically as auto increment value. Therefor the value is NULL and this is invalid (as it most certain is also the primary key for the entity)

Good luck!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900