Skip to content
This repository was archived by the owner on Apr 11, 2020. It is now read-only.
This repository was archived by the owner on Apr 11, 2020. It is now read-only.

Creating Edit View with Non EFModel #1096

Description

@GaryFurash

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions