コード例 #1
0
 public RecipeSearchFilterCriteria(FindRecipeDetailsQuery query, double deviation)
 {
     Requirements           = query.Requirements?.ToRequirements() ?? Requirement.None;
     NotAllowedAllergens    = query.NotAllowedAllergens?.ToAllergens() ?? Allergen.None;
     AllowedMealTypes       = query.AllowedMealTypes?.ToMealType() ?? MealType.None;
     CaloriesRange          = GetCaloriesRange(deviation, query.CaloriesLowerLimit, query.CaloriesUpperLimit);
     MacroNutrientsQuantity = GetMacroNutrientQuantity(query.MacroNutrientsQuantity, deviation);
 }
コード例 #2
0
        public IActionResult FindRecipeDetails([FromBody] FindRecipeDetailsQuery query)
        {
            var result = _mediator.Query(query);

            return(Ok(result));
        }