예제 #1
0
        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);
            }
        }
예제 #2
0
 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);
 }