示例#1
0
 public static bool InRangeCarbohydrate(this ICaloriesProvider product, int?min, int?max)
 {
     if (min.HasValue && product.Carbohydrate < min.Value)
     {
         return(false);
     }
     if (max.HasValue && product.Carbohydrate > max.Value)
     {
         return(false);
     }
     return(true);
 }
示例#2
0
 public static bool InRangeFat(this ICaloriesProvider product, int?min, int?max)
 {
     if (min.HasValue && product.Fat < min.Value)
     {
         return(false);
     }
     if (max.HasValue && product.Fat > max.Value)
     {
         return(false);
     }
     return(true);
 }
示例#3
0
 public static bool InRangeCarbohydrate(this ICaloriesProvider product, SearchRange range)
 {
     return(product.InRangeCarbohydrate(range.MinValue, range.MaxValue));
 }
示例#4
0
 public static bool InRangeProtein(this ICaloriesProvider product, SearchRange range)
 {
     return(product.InRangeProtein(range.MinValue, range.MaxValue));
 }