I am creating a reusable library using .NET Core (targeting .NETStandard 1.4) and I am using Entity Framework Core (and new to both). I have an entity class that looks like
For developers, who work with EF Core 3.1 and meet such error ("The entity type 'XXX' requires a primary key to be defined. If you intended to use a keyless entity type call 'HasNoKey()'.") the solution is just to move .HasConversion() method with it's lambda from: public class OrderConfiguration : IEntityTypeConfiguration to: protected override void OnModelCreating(ModelBuilder modelBuilder) //in YourModelContext : DbContext class.