Пример #1
0
        public static TypeParam IsOfType(this TypeParam param, Type type)
        {
            if (!param.Type.Equals(type))
            {
                throw ExceptionFactory.CreateForParamValidation(
                          param.Name, ExceptionMessages.EnsureExtensions_IsNotOfType.Inject(param.Type.FullName));
            }

            return(param);
        }
Пример #2
0
 public static TypeParam IsString(this TypeParam param)
 {
     return(IsOfType(param, Types.StringType));
 }
Пример #3
0
 public static TypeParam IsShort(this TypeParam param)
 {
     return(IsOfType(param, Types.ShortType));
 }
Пример #4
0
 public static TypeParam IsInt(this TypeParam param)
 {
     return(IsOfType(param, Types.IntType));
 }
Пример #5
0
 public static TypeParam IsFloat(this TypeParam param)
 {
     return(IsOfType(param, Types.FloatType));
 }
Пример #6
0
 public static TypeParam IsDouble(this TypeParam param)
 {
     return(IsOfType(param, Types.DoubleType));
 }
Пример #7
0
 public static TypeParam IsDecimal(this TypeParam param)
 {
     return(IsOfType(param, Types.DecimalType));
 }
Пример #8
0
 public static TypeParam IsDateTime(this TypeParam param)
 {
     return(IsOfType(param, Types.DateTimeType));
 }
Пример #9
0
 public static TypeParam IsBool(this TypeParam param)
 {
     return(IsOfType(param, Types.BoolType));
 }