Exemplo n.º 1
0
        public async Task <IList <ProductoDTO> > GetAllActive()
        {
            try
            {
                List <ProductoDTO> productos = await _productoRepository.FindByCondition(x => x.EstaActivo == true).
                                               Select(p => new ProductoDTO
                {
                    IdProducto        = p.IdProducto,
                    Nombre            = p.Nombre,
                    Descripcion       = p.Descripcion,
                    Precio            = p.Precio,
                    Cantidad          = p.Cantidad,
                    CantidadExistente = p.CantidadExistente
                }).ToListAsync();

                return(productos);
            }
            catch (Exception e)
            {
                throw e;
            }
        }