public PoolViewModel CreatePool(PoolViewModel poolViewModel) { try { // TODO seems like redundant conversions here var entity = poolViewModel.ToPoolModel(); _poolRepository.UpdateAndCommit(entity); _activityHelperService.CreateAddedPoolActivity(entity); return entity.ToPoolViewModel(); } catch (Exception ex) { _logger.Log(ex); return null; } }
// TODO think of join add and edit methods public void UpdatePool(PoolViewModel poolViewModel) { try { _poolRepository.UpdateAndCommit(poolViewModel.ToPoolModel()); } catch (Exception ex) { _logger.Log(ex); } }
public bool IsPoolNameExistExceptCurrentPool(PoolViewModel pool) { try { return _poolRepository.Query().Any(p => (p.Name.ToLower() == pool.Name.ToLower() && p.Id != pool.Id)); } catch (Exception ex) { _logger.Log(ex); return false; } }