How to ignore entity in Entity Framework Code first via setup
问题 Lets say i have 4 classes: public class Component {} public class SubComponent1 : Component {} public class SubComponent2 : Component {} public class Container : Component { public List<Component> components { get; set;} } And I don't want to store SubComponent2 on database. I want to use it throughout application as normal POCO, only want it to be ignored when trying to save to database. What I have tried so far was to put Ignore for it in my DbContext OnModelCreating method: dbModelBuilder