You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support Ignore() for non entity type candidates #3867
Currently Ignore<T>() with T being a candidate entity type will cause Code First to:
Not try to include T in the model as an entity type.
Ignore any property of type T declared on valid entity types.
Ignore currently doesn't work for T unless it is a candidate entity type. However it would be possibly more consistent and useful to extend it to ignore properties of other types, e.g.:
Types that would not be handled by the type mapper but that would not be valid candidate entity types either, including:
Any interface types.
Any value types (e.g. unsigned integers with the SQL Server provider).
Types that would otherwise be handled by the type mapper but that the user wishes to exclude.
changed the title [-]Code First: Decide on behavior of Ignore() for non entity type candidates[/-][+]Support Ignore() for non entity type candidates[/+]on Dec 10, 2015
We decided not to change what we currently do for Ignore<T>(), i.e. it is only supported to prevent types that would otherwise be pulled as candidate entity types from getting into the model.
You can still use Ignore(property) (i.e. the version that takes a property expression or name) to ignore any specific properties in an entity type for all the other scenarios.
Moving to backlog to track this as a possible post-RTM improvement.
Activity
rowanmiller commentedon Dec 1, 2015
We need to decide on what properties we include in the model before deciding on this
[-]Code First: Decide on behavior of Ignore() for non entity type candidates[/-][+]Support Ignore() for non entity type candidates[/+]divega commentedon Jan 20, 2016
We decided not to change what we currently do for
Ignore<T>(), i.e. it is only supported to prevent types that would otherwise be pulled as candidate entity types from getting into the model.You can still use
Ignore(property)(i.e. the version that takes a property expression or name) to ignore any specific properties in an entity type for all the other scenarios.Moving to backlog to track this as a possible post-RTM improvement.
8 remaining items
Add pre-convention model configuration.
Allow to ignore entity types and properties by base type or interface
Allow to ignore entity types and properties by base type or interface
Allow to ignore entity types and properties by base type or interface
Allow to ignore entity types and properties by base type or interface
Allow to ignore entity types and properties by base type or interface
Allow to ignore entity types and properties by base type or interface (…