예제 #1
0
 public static TagActionExpression IfPropertyTypeIsNullableEnum(this TagFactoryExpression expression)
 {
     return(expression.If(f =>
     {
         var propertyType = f.Accessor.InnerProperty.PropertyType;
         return propertyType.IsGenericType &&
         propertyType.GetGenericTypeDefinition() == typeof(Nullable <>) &&
         new NullableConverter(propertyType).UnderlyingType.IsEnum;
     }));
 }
예제 #2
0
 public static TagActionExpression IfPropertyIs <T1, T2>(this TagFactoryExpression expression)
 {
     return(expression.If(req => req.Accessor.PropertyType == typeof(T1) || req.Accessor.PropertyType == typeof(T2)));
 }
예제 #3
0
 public static TagActionExpression IfPropertyHasAttribute <T>(this TagFactoryExpression expression) where T : Attribute
 {
     return(expression.If(req => req.Accessor.HasAttribute <T>()));
 }