public ResponseEntity DeleteSpotifyPlayList(SpotifyPlayListBE playListBE) { ResponseEntity response; try { var entity = new SpotifyPlayList { IdList = playListBE.IdList }; _contexto.SpotifyPlayList.Remove(entity); _contexto.SaveChanges(); response = new ResponseEntity { Message = "Eliminacion Correcta", Status = true, Date = DateTime.Now }; } catch (Exception ex) { response = new ResponseEntity { Message = ex.Message, Status = false, Date = DateTime.Now }; } return(response); }
public ResponseEntity UpdateSpotifyPlayList(SpotifyPlayListBE playListBE) { ResponseEntity response; try { var entity = new SpotifyPlayList { IdList = playListBE.IdList, Titulo = playListBE.Titulo, Album = playListBE.Album, Artista = playListBE.Artista, Duracion = playListBE.Duracion, }; _contexto.SpotifyPlayList.Update(entity); _contexto.SaveChanges(); response = new ResponseEntity { Message = "Actualizacion Correcta", Status = true, Date = DateTime.Now }; } catch (Exception ex) { response = new ResponseEntity { Message = ex.Message, Status = false, Date = DateTime.Now }; } return(response); }
public PlayListController(IMapper mapper, SpotifyPlayList playListRepo, ICookieManager cookiesManager, FullPlayListViewModel model) { _mapper = mapper; _playListRepo = playListRepo; _cookiesManager = cookiesManager; _model = model; }