public bool UpdateSession(SessionTO sessionTO) { if (sessionTO is null) { throw new ArgumentNullException((nameof(sessionTO))); } if (sessionTO.Id == 0) { throw new Exception("User does not exist"); } try { iRSUnitOfWork.SessionRepository.Update(sessionTO.ToDomain().ToTransfertObject()); return(true); } catch (Exception) { throw; } }
public bool AddSession(SessionTO sessionTO) { if (sessionTO is null) { throw new ArgumentNullException(nameof(sessionTO)); } if (sessionTO.Id != 0) { throw new Exception("Existing Session"); } try { iRSUnitOfWork.SessionRepository.Add(sessionTO.ToDomain().ToTransfertObject()); return(true); } catch (Exception) { throw; } }