public void Update(Playlist playlist) { try { NHibernateSessionManager.Instance.BeginTransaction(); playlist.ValidateAndThrow(); Playlist knownPlaylist = PlaylistDao.Get(playlist.Id); if (knownPlaylist == null) { PlaylistDao.Update(playlist); } else { PlaylistDao.Merge(playlist); } NHibernateSessionManager.Instance.CommitTransaction(); } catch (Exception exception) { Logger.Error(exception); NHibernateSessionManager.Instance.RollbackTransaction(); throw; } }
public void UpdateTitle(Guid playlistId, string title) { try { Playlist playlist = PlaylistDao.Get(playlistId); playlist.Title = title; PlaylistDao.Update(playlist); } catch (Exception exception) { Logger.Error(exception); throw; } }
public void UpdateFirstItem(Guid playlistId, Guid firstItemId) { try { NHibernateSessionManager.Instance.BeginTransaction(); Playlist playlist = PlaylistDao.Get(playlistId); playlist.FirstItem = PlaylistItemDao.Get(firstItemId); PlaylistDao.Update(playlist); NHibernateSessionManager.Instance.CommitTransaction(); } catch (Exception exception) { Logger.Error(exception); NHibernateSessionManager.Instance.RollbackTransaction(); throw; } }
public void UpdateTitle(Guid playlistId, string title) { try { NHibernateSessionManager.Instance.BeginTransaction(); Playlist playlist = PlaylistDao.Get(playlistId); playlist.Title = title; PlaylistDao.Update(playlist); NHibernateSessionManager.Instance.CommitTransaction(); } catch (Exception exception) { Logger.Error(exception); NHibernateSessionManager.Instance.RollbackTransaction(); throw; } }
public void Update(Playlist playlist) { try { playlist.ValidateAndThrow(); Playlist knownPlaylist = PlaylistDao.Get(playlist.Id); if (knownPlaylist == null) { PlaylistDao.Update(playlist); } else { PlaylistDao.Merge(playlist); } } catch (Exception exception) { Logger.Error(exception); throw; } }
public void Update(Playlist playlist) { try { playlist.ValidateAndThrow(); // TODO: Is this necessary still? Seems odd to me. Playlist knownPlaylist = PlaylistDao.Get(playlist.Id); if (knownPlaylist == null) { PlaylistDao.Update(playlist); } else { PlaylistDao.Merge(playlist); } } catch (Exception exception) { Logger.Error(exception); throw; } }