public static ElementActionExpression ForProperty <TModel, TProperty>( this ElementCategoryExpression config, Expression <Func <TModel, TProperty> > expression) { return(config.If(m => m.Accessor.OwnerType == typeof(TModel) && m.Accessor.PropertyNames.Contains(expression.ToAccessor().Name))); }
public static ElementActionExpression IfPropertyIsNumber(this ElementCategoryExpression expression) { return(expression.If(req => req.Accessor.PropertyType == typeof(int) || req.Accessor.PropertyType == typeof(long) || req.Accessor.PropertyType == typeof(decimal) || req.Accessor.PropertyType == typeof(float))); }
public static ElementActionExpression IfPropertyTypeAndAttribute <TType, TAttribute>( this ElementCategoryExpression expression) where TAttribute : Attribute => expression.If(req => req.Accessor.PropertyType == typeof(TType) && req.Accessor.HasAttribute <TAttribute>());
public static ElementActionExpression IfPropertyIs <TType, TOrType>( this ElementCategoryExpression expression) => expression.If(req => req.Accessor.PropertyType == typeof(TType) || req.Accessor.PropertyType == typeof(TOrType));
public static ElementActionExpression IfPropertyNameIs(this ElementCategoryExpression expression, string text) { return(expression.If(m => m.Accessor.Name.Equals(text))); }
public static ElementActionExpression IfPropertyNameEnds(this ElementCategoryExpression expression, string endsWith) { return(expression.If(m => m.Accessor.Name.EndsWith(endsWith))); }