You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
SAE-2.01/MCTG/ConsoleApp/Menu/SearchUserRecipes.cs

31 lines
981 B

using Model;
using Model.Managers;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp.Menu
{
internal class SearchUserRecipes : SearcherRecipe
{
MasterManager masterMgr;
public SearchUserRecipes(MasterManager masterManager) : base(new RecipeCollection("My recipes"))
{
masterMgr = masterManager;
}
public override void Update()
{
_recipeCollectionOnSearch =
new RecipeCollection("My recipes", masterMgr.DataMgr.GetFromData<Recipe>()
.Where(r => r.AuthorMail == MasterManager.CurrentConnectedUser?.Mail)
.ToArray());
_allSelectors = ConvertRecipeCollectionInSelectors();
base.Update();
}
}
}