Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public async Task<Either<Exception, List<Clientes>>> BuscarClientes()
- {
- return await GetAllByAsync(x => true)
- .BindAsync(clientes =>
- {
- clientes = clientes.Where(x => x.ativo == "S")
- .OrderBy(x => x.Nome)
- return clientes
- }
- }
- public virtual async Task<Either<Exception, IEnumerable<TEntity>>> GetAllByAsync(Expression<Func<TEntity, bool>> funcao)
- {
- try
- {
- return Right<Exception, Option<TEntity>>(await DBEntity.Where(funcao).ToListAsync());
- }
- catch
- {
- return ex;
- }
- }
Add Comment
Please, Sign In to add comment