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/Program.cs

35 lines
1.2 KiB

// See https://aka.ms/new-console-template for more information
using ConsoleApp;
using ConsoleApp.Menu;
using DataPersistence;
using Model;
using System.Linq;
using System.Text;
Console.WriteLine("Hello, World!\n\n");
// TESTS:
//DataManager dataMgr = new DataManager(new Stubs());
//DataManager dataMgr = new DataManager(new DataContractXML(xmlFolderPath: "../../../../DataPersistence/data"));
DataManager dataMgr = new DataManager(new DataContractJSON(jsonFolderPath: "../../../../DataPersistence/data"));
//dataMgr.Serializer = new DataContractXML(xmlFolderPath: "../../../../DataPersistence/data");
//dataMgr.Serializer = new DataContractJSON(jsonFolderPath: "../../../../DataPersistence/data");
// /!\ here is an absolute path I put for testing purpose. It will only work on my computer so don't forget to change it whene you test.
//dataMgr.Export(rc[2], "C:\\Users\\alex6\\Downloads\\recipe2.json");
//dataMgr.Import<Recipe>("C:\\Users\\alex6\\Downloads\\recipe2.json");
RecipeCollection rc = new RecipeCollection("All recipes", dataMgr.Data[nameof(Recipe)].Cast<Recipe>().ToArray());
Recipe? ret = SearcherRecipe.ResearchOn(rc);
Console.WriteLine(ret);
dataMgr.Save();
// press any key to quit
Console.ReadKey();