Using latest ASP.NET Core with latest Nuget on Visual Studio 2019 windows 10 pro.
If I try to create an Edit view based on a view model that isn't configured in the DB context (e.g., it's a model that doesn't map to a DB table in EF), even after adding the [Key] annotation I get the error:
'The entity type 'RoleEdit' requires a primary key to be defined. If you intended to use a keyless entity type call 'HasNoKey()'.'
I can't use HasNoKey since the model entity isn't in the context since it isn't a real table.
Using latest ASP.NET Core with latest Nuget on Visual Studio 2019 windows 10 pro.
If I try to create an Edit view based on a view model that isn't configured in the DB context (e.g., it's a model that doesn't map to a DB table in EF), even after adding the [Key] annotation I get the error:
'The entity type 'RoleEdit' requires a primary key to be defined. If you intended to use a keyless entity type call 'HasNoKey()'.'
I can't use HasNoKey since the model entity isn't in the context since it isn't a real table.