Generate Entity Framework Entity Data Model in Visual Studio 2017

Visual Studio 2017 has many project type options, and not all of them support the Entity Framework user interface to generate the Entity Framework Data Model (EDMX) file. If you create an ASP.NET Web Application(.NET Framework) you can add the EDMX file to it. The .NET Core projects do not support the Entity Framework Data Model […]

{“error”:”Entity type ‘AspNetUserRoles’ has composite primary key defined with data annotations. To set composite primary key, use fluent API.”}

When a database table has composite keys (multiple columns are in the key) you cannot use the usual key definition [Key] [Display(Name = “UserId”)] public string UserId { get; set; } [Key] [Display(Name = “RoleId”)] public string RoleId { get; set; } When you run the application you get the error message: {“error”:”Entity type ‘AspNetUserRoles’ has composite […]