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.
34 lines
877 B
34 lines
877 B
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Security.Cryptography.X509Certificates;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
using Model;
|
|
|
|
namespace ConsoleApp.Menu
|
|
{
|
|
/// <summary>
|
|
/// An utility to find a recipe.
|
|
/// </summary>
|
|
internal class SearcherRecipe : Menu<Recipe>
|
|
{
|
|
public SearcherRecipe(RecipeCollection recipeCollection) : base("Search recipe")
|
|
{
|
|
foreach (Recipe recipe in recipeCollection)
|
|
{
|
|
_selectList.Add(new Selector<Recipe>(recipe, $"[{recipe.Id}]: {recipe.Title}"));
|
|
}
|
|
CurrentSelected = _selectList[0].Item;
|
|
}
|
|
|
|
#region Methodes
|
|
public override void Return()
|
|
{
|
|
Console.WriteLine(CurrentSelected);
|
|
}
|
|
#endregion
|
|
}
|
|
}
|