Exemplo n.º 1
0
        public void UpdateAccount(WhatYouGotLibrary.Models.Account account)
        {
            Entities.Account currentAccount = _context.Account.Find(account.Id);
            Entities.Account newAccount     = Mapper.Map(account);

            _context.Entry(currentAccount).CurrentValues.SetValues(newAccount);
        }
        public void UpdateRecipe(WhatYouGotLibrary.Models.Recipe recipe)
        {
            Entities.Recipe currentRecipe = _context.Recipe.Find(recipe.Id);
            Entities.Recipe newRecipe     = Mapper.Map(recipe);

            _context.Entry(currentRecipe).CurrentValues.SetValues(newRecipe);
        }
Exemplo n.º 3
0
        public void UpdateInstruction(WhatYouGotLibrary.Models.Instruction instruction)
        {
            Entities.Instruction currentInstruction = _context.Instruction.Find(instruction.Id);
            Entities.Instruction newInstruction     = Mapper.Map(instruction);

            _context.Entry(currentInstruction).CurrentValues.SetValues(newInstruction);
        }
Exemplo n.º 4
0
        public void UpdateFavorite(WhatYouGotLibrary.Models.Favorite favorite)
        {
            Entities.Favorite currentFavorite = _context.Favorite.Find(favorite.Id);
            Entities.Favorite newFavorite     = Mapper.Map(favorite);

            _context.Entry(currentFavorite).CurrentValues.SetValues(newFavorite);
        }
        public void UpdateIngredient(WhatYouGotLibrary.Models.Ingredient ingredient)
        {
            Entities.Ingredient currentIngredient = _context.Ingredient.Find(ingredient.Id);
            Entities.Ingredient newIngredient     = Mapper.Map(ingredient);

            _context.Entry(currentIngredient).CurrentValues.SetValues(newIngredient);
        }
        public void UpdateReview(WhatYouGotLibrary.Models.Review review)
        {
            IQueryable <Entities.Review> reviews = from r in _context.Review
                                                   where r.UserId == review.UserId & r.RecipeId == review.RecipeId
                                                   select r;

            Entities.Review currentReview = reviews.FirstOrDefault();
            Entities.Review newReview     = Mapper.Map(review);

            _context.Entry(currentReview).CurrentValues.SetValues(newReview);
        }