/// <summary> /// Initializes a new instance of the <see cref="GarnishSelectViewModel"/> class. /// </summary> /// <param name="dialogService">Dialog service dependency.</param> /// <param name="garnishService">Tag service dependency.</param> /// <param name="selectedGarnishes">Loc25 provider dependency.</param> public GarnishSelectViewModel(DialogService dialogService, CRUDService <Recipe> garnishService, IEnumerable <RecipeEdit> selectedGarnishes) : base(dialogService) { AllGarnishes = garnishService.GetMapped <RecipeEdit>(x => x.Tags.Any(t => t.Name == "Гарниры")).OrderBy(x => x.Name).ToList(); SelectedItems.AddRange(AllGarnishes.Intersect(selectedGarnishes)); }