Exemplo n.º 1
0
 public void Delete(Guid id)
 {
     using (ITransaction transaction = Session.BeginTransaction())
     {
         PlaylistItemManager.Delete(id);
         transaction.Commit();
     }
 }
Exemplo n.º 2
0
        public void DeletePlaylistItem_NoOtherItems_MakesPlaylistEmpty()
        {
            PlaylistItem playlistItem = Helpers.CreateItemInPlaylist(Playlist);

            //  Now delete the created PlaylistItem and ensure it is removed.
            PlaylistItemManager.Delete(playlistItem.Id);

            bool exceptionEncountered = false;

            try
            {
                PlaylistItemManager.Get(playlistItem.Id);
            }
            catch (ObjectNotFoundException)
            {
                exceptionEncountered = true;
            }

            Assert.IsTrue(exceptionEncountered);
        }
        public JsonResult Delete(Guid id)
        {
            using (ITransaction transaction = Session.BeginTransaction())
            {
                PlaylistItemManager.Delete(id);
                transaction.Commit();
            }

            return(Json(new
            {
                success = true
            }));
        }