internal static void IgnoredBy <TStructuralType, TProperty>(this Expression <Func <TStructuralType, TProperty> > propertyExpression, StructuralTypeConfiguration <TStructuralType> configuration) where TStructuralType : class { Contract.Requires(propertyExpression != null); Contract.Requires(configuration != null); var visitor = new InitialPropertyVisitor(); visitor.Visit(propertyExpression); var property = visitor.InitialProperty; // remove the property from the configuration (equivalent to Ignore, but without using Reflection to create the required generic method) // note: we only need to consider ignoring properties. fields, methods, and indexers can be used, but are never exposed in the entity model if (property != null) { configuration.GetInnerConfiguration().RemoveProperty(property); } }
public static ODataModelBuilder GetModelBuilder <TStructuralType>(this StructuralTypeConfiguration <TStructuralType> configuration) where TStructuralType : class { Arg.NotNull(configuration, nameof(configuration)); Contract.Ensures(Contract.Result <ODataModelBuilder>() != null); return(configuration.GetInnerConfiguration().ModelBuilder); }