static void Main(string[] args) { SortedDictionary <string, DrinkMultiple> repository = new SortedDictionary <string, DrinkMultiple>(); var drinkMulti = new DrinkMultiple(); var drink = new Drink(); drink.idDrink = 12345; drink.strDrink = "Hello World22"; drink.strIngredient1 = "Lemon"; drinkMulti.Drinks = new List <Drink>() { drink }; Repository.SaveData(drinkMulti, "Lemon"); repository = Repository.GetSavedData(); }
public static void SaveData(DrinkMultiple newDrinkMultiple, string newSearchedIngridient) { var serilizer = new SharpSerializer(); repository.Add(newSearchedIngridient, newDrinkMultiple); serilizer.Serialize(repository, fileName); }