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