Ejemplo n.º 1
0
        public AlbumFavorites Eliminar(int id)
        {
            AlbumFavorites a = contexto.AlbumFavorites.Find(id);

            if (a != null)
            {
                contexto.AlbumFavorites.Remove(a);
                contexto.SaveChanges();
            }
            return(a);
        }
Ejemplo n.º 2
0
        public AlbumFavorites Agregar(int id, string title, int idAlbum)
        {
            AlbumFavorites af = new AlbumFavorites();

            af.Id      = id;
            af.Title   = title;
            af.IdAlbum = idAlbum;

            contexto.AlbumFavorites.Add(af);
            contexto.SaveChanges();

            return(af);
        }