public async Task <IEnumerable <ClientesViewModel> > GetAllAsync()
        {
            var loggedClient            = GetClienteByIdUsuario();
            var result                  = new PagedResult <ClientesViewModel>();
            IEnumerable <Clientes> data = null;

            if (loggedClient != null)
            {
                var models = await _rep.GetAllAsync();

                data = models.Where(t => t.Id == loggedClient.Id);
            }
            else
            {
                data = await _rep.GetAllAsync();
            }

            return(Mapper.Map <IEnumerable <ClientesViewModel> >(data));
        }
Beispiel #2
0
 public async Task <IEnumerable <Clientes> > GetAllAsync()
 {
     return(await _clienteRepository.GetAllAsync());
 }