public RangeAttribute(string lowerBound, string upperBound, Range.BoundTypes lowerBoundType = Range.BoundTypes.Exclusive, Range.BoundTypes upperBoundType = Range.BoundTypes.Exclusive)
        {
            LowerBound = lowerBound;
            UpperBound = upperBound;

            LowerBoundType = lowerBoundType;
            UpperBoundType = upperBoundType;
        }
        public DbParameterSharedRangeData(PropertyInfo property, object[] typeAttributes) : this(property) {
            GetDataFromAttributes(property, typeAttributes);
            var rangeAttribute = property.GetCustomAttribute<RangeAttribute>();

            LowerBoundFilter = rangeAttribute?.LowerBound ?? string.Empty;
            UpperBoundFilter = rangeAttribute?.UpperBound ?? string.Empty;
            LowerBoundType = rangeAttribute?.LowerBoundType ?? Range.BoundTypes.Inclusive;
            UpperBoundType = rangeAttribute?.UpperBoundType ?? Range.BoundTypes.Inclusive;
        }
示例#3
0
 public static Range <T> CreateRange <T>(T lowerBound, T upperBound, Range.BoundTypes lowerBoundType, Range.BoundTypes upperBoundType) where T : IComparable <T>
 {
     return(new Range <T>(lowerBound, upperBound, lowerBoundType, upperBoundType));
 }