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); }
public IActionResult FindRecipeDetails([FromBody] FindRecipeDetailsQuery query) { var result = _mediator.Query(query); return(Ok(result)); }