Beispiel #1
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 static Entities.Favorite Map(WhatYouGotLibrary.Models.Favorite favorite)
 {
     return(new Entities.Favorite
     {
         Id = favorite.Id,
         UserId = favorite.UserId,
         RecipeId = favorite.RecipeId
     });
 }
Beispiel #3
0
 public void AddFavorite(WhatYouGotLibrary.Models.Favorite favorite)
 {
     Entities.Favorite newFavorite = Mapper.Map(favorite);
     _context.Add(newFavorite);
 }