private void GetAlternativeRecipe(DayPlan day) { day.Recipe = day.Recipe !.Name == day.RecipeAlternatives?.Last().Name ? day.RecipeAlternatives?[0] : day.RecipeAlternatives?.SkipWhile(x => x.Name != day.Recipe.Name).Skip(1).First(); day.Garnish = day.Recipe !.Garnishes.RandomElement(); }
private void GetAlternativeGarnish(DayPlan day) { DayPlanRecipe?lastGarnish = day.Garnish; do { day.Garnish = day.Recipe !.Garnishes.RandomElement(); }while (day.Garnish == lastGarnish); }