public async Task <bool> CriarConta(Conta model) { if (_repositoryConta.GetAll().Where(x => x.NumConta == model.NumConta).Count() > 0) { throw new NumContaJaExistenteException(model.NumConta); } try { await _repositoryConta.AddAsync(model); await _uow.CommitAsync(); return(true); } catch (Exception) { return(false); } }
public IEnumerable <Conta> GetAll() { return(repo.GetAll()); }