Guest User

Untitled

a guest
Jul 16th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. public async Task<Either<Exception, List<Clientes>>> BuscarClientes()
  2. {
  3. return await GetAllByAsync(x => true)
  4. .BindAsync(clientes =>
  5. {
  6. clientes = clientes.Where(x => x.ativo == "S")
  7. .OrderBy(x => x.Nome)
  8. return clientes
  9. }
  10. }
  11.  
  12. public virtual async Task<Either<Exception, IEnumerable<TEntity>>> GetAllByAsync(Expression<Func<TEntity, bool>> funcao)
  13. {
  14. try
  15. {
  16. return Right<Exception, Option<TEntity>>(await DBEntity.Where(funcao).ToListAsync());
  17. }
  18. catch
  19. {
  20. return ex;
  21. }
  22. }
Add Comment
Please, Sign In to add comment