public static bool CompareTo(this byte self, HallOfBeorn.Models.NumericOperator op, string other) { byte result = 0; if (!byte.TryParse(other, out result)) { return(false); } switch (op) { case Models.NumericOperator.eq: default: return(self == result); case Models.NumericOperator.gt: return(self > result); case Models.NumericOperator.gteq: return(self >= result); case Models.NumericOperator.lt: return(self < result); case Models.NumericOperator.lteq: return(self <= result); } }
public static bool CompareTo(this byte?self, HallOfBeorn.Models.NumericOperator op, string other) { if (!self.HasValue) { return(false); } return(self.Value.CompareTo(op, other)); }