public async Task <IActionResult> List(int id, string name = null, DateTime?creationDateFrom = null, DateTime?creationDateTo = null)
        {
            try
            {
                var filters  = new StockRecursoMaterialFilterDTO(name, creationDateFrom, creationDateTo);
                var entities = await _stockRecursoMaterialService.List(this.Usuario, id, filters);

                return(Ok(entities));
            }
            catch (Exception)
            {
                throw;
            }
        }
        public async Task <IEnumerable <StockRecursoMaterialDTO> > List(UsuarioDTO userlogged, int id, StockRecursoMaterialFilterDTO filter = null)
        {
            var entities = await _stockRecursoMaterialRepository.ListBy(stock =>
                                                                        (
                                                                            (stock.IdRecursoMaterial == id) &&
                                                                            (!filter.CreationDateFrom.HasValue || stock.CreationDate >= filter.CreationDateFrom.Value) &&
                                                                            (!filter.CreationDateTo.HasValue || stock.CreationDate <= filter.CreationDateTo.Value) &&

                                                                            (
                                                                                filter.Name.IsNullOrEmpty() ||
                                                                                stock.CantidadDisponible.ToString().Contains(filter.Name) ||
                                                                                stock.CantidadTotal.ToString().Contains(filter.Name) ||
                                                                                stock.IdUbicacionNavigation.Referencia.Contains(filter.Name)
                                                                            )
                                                                        ) &&
                                                                        stock.Active == true,
                                                                        s => s.IdRecursoMaterialNavigation,
                                                                        s => s.IdUbicacionNavigation
                                                                        );

            var entitiesDTO = _mapper.Map <IEnumerable <StockRecursoMaterialDTO> >(entities);

            foreach (var item in entitiesDTO)
            {
                item.RefUbicacion = item.IdUbicacionNavigation.Referencia;
            }

            return(entitiesDTO);
        }