Exemple #1
0
        public static void CreateNewIngredient(string title, string measureType)
        {
            var database = new SQLiteDataService();

            database.Initialize();
            var newIngredient = new Ingredient {
                Title = title, MeasureType = measureType, CreatedBy = currentUser.Username, CreatedDate = DateTime.Now
            };

            database.AddIngredient(newIngredient);
            database.Close();
            AllIngredients.Add(new IngredientViewModel(newIngredient));
        }