Relate Multiple Tables to Single General Purpose Table in Entity Framework Code First
问题 Many times I have a general purpose entity that other entities contain a collection of. I don't want to have a new collection entity for each parent entity type that needs it but would like to re-use a single general purpose entity. For performance reasons, I also don't want to explicitly define many-to-many relationships as in this answer. The simplest example would be a collection of strings. public class MyString { public Guid Id { get; set; } public string Value { get; set; } } public