base.OnModelCreating(builder);
The entity type 'IdentityUserLogin<string>' requires a primary key to be defined. If you intended to use a keyless entity type, call 'HasNoKey' in 'OnModelCreating'.
protected override void OnModelCreating(ModelBuilder builder) { base.OnModelCreating(builder); builder.Entity<Ticket>() .HasOne(x => x.Zitplaats) .WithMany(x => x.Tickets) .HasForeignKey(x => x.ZitplaatsId) .OnDelete(DeleteBehavior.NoAction); }
DeleteBehavior.NoAction
public class Game{ [Column("id")] public int Id { get; set; } public string Name { get; set; } public List<Event> Events { get; set; }}