public static void PopulateDatabaseWithRecipess(IMealDBService db) { using (TransactionScope scope = new TransactionScope()) { Recipe recipe1 = new Recipe() { Name = "Tiny Lasagna", Description = "Teeny Tiny Lasagna", Instructions = "Cook very well, with much skill.", CookTime = 45, PrepTime = 25, CreatorId = 1 }; db.AddRecipe(recipe1); Recipe recipe2 = new Recipe() { Name = "Tiny Eggs", Description = "Teeny Tiny Eggs", Instructions = "Cook very well, with much skill.", CookTime = 5, PrepTime = 5, CreatorId = 1 }; db.AddRecipe(recipe2); scope.Complete(); } }
public static void PopulateDatabaseWithIngredients(IMealDBService db) { using (TransactionScope scope = new TransactionScope()) { Ingredient ingredient1 = new Ingredient() { Name = "butter", UserId = 1 }; Ingredient ingredient2 = new Ingredient() { Name = "flour", UserId = 1 }; scope.Complete(); } }
public static void PopulateDatabaseWithUsers(IMealDBService db) { using (TransactionScope scope = new TransactionScope()) { PasswordHelper passHelper = new PasswordHelper("a"); User user = new User() { FirstName = "Mister", LastName = "Pink", Username = "******", Email = "*****@*****.**", }; user.Hash = passHelper.Hash; user.Salt = passHelper.Salt; user.Id = db.AddUser(user); scope.Complete(); } }
public PantryController(IMealDBService dal) : base(dal) { _dal = dal; }
public RecipeController(IMealDBService dal) : base(dal) { _dal = dal; }
/// <summary> /// Getting access to DB /// </summary> /// <param name="db"></param> public MealPlanController(IMealDBService dal) : base(dal) { _dal = dal; }
public UserController(IMealDBService dal) : base(dal) { _dal = dal; }
/// <summary> /// Getting access to DB /// </summary> /// <param name="db"></param> public BaseController(IMealDBService dal) { _dal = dal; }