EF Core / DbContext > Map custom type as primary key
问题 Using the fluent api, how do I map a custom type as the primary key within my OnModelCreating method of the DbContext class? Using EF Core I'm trying to build a model for the follow entity. public class Account { public AccountId AccountId { get; } public string Name { get; set; } private Account() { } public Account(AccountId accountId, string name) { AccountId = accountId; Name = name; } } Where the primary key is the AccountId ; the type is a simple value object like this. public class