Define Entity Framework relationships using foreign keys only by FluentAPI
问题 Is any way of defining Entity Framework relations using foreign keys only (no virtual properties of reference type) with FluentAPI (data models should not be changed)? CardDataModel public class CardDataModel { public int CardId { get; set; } } CheckItemDataModel public class CheckItemDataModel { public int CheckItemId { get; set; } public int CardId { get; set; } } 回答1: Yes, it's possible in EF Core. It wasn't in EF6 and below, but now EF Core provides parameterless overloads of HasMany /