Я получаю эту ошибку с Identity Framework и Core .Net 2.2:
InvalidOperationException: The entity type 'IdentityUserLogin'
requires a primary key to be defined.
Я посмотрел другие ответы и попробовал рекомендации, но они для более ранних версий.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Ca.Models;
namespace Ca.Areas.Identity.Data
{
public class RMISContext : IdentityDbContext<IdentityUser>
{
private object modelBuilder;
public RMISContext(DbContextOptions<RMISContext> options)
: base(options)
{
}
protected override void OnModelCreating(ModelBuilder builder)
{
base.OnModelCreating(builder);
// Customize the ASP.NET Identity model and
override the defaults if needed.
// For example, you can rename the ASP.NET Identity table
names and more.
// Add your customizations after calling base.OnModelCreating
(builder);
}
}
}
Я ожидаю, что смогу зарегистрироваться как новый пользователь, но вместо этого получаю сообщение об ошибке, как показано ранее.Любая помощь очень ценится.