Esempio n. 1
0
        public IActionResult GetProperties([FromBody] PropertyFilterModel filter)
        {
            filter.ThrowBadRequestIfNull($"The request must include a filter.");
            if (!filter.IsValid())
            {
                throw new BadRequestException("Property filter must contain valid values.");
            }

            var properties = _pimsService.Property.Get((AllPropertyFilter)filter).ToArray();

            return(new JsonResult(_mapper.Map <PropertyModel[]>(properties).ToArray()));
        }
Esempio n. 2
0
        public IActionResult GetPropertyNames([FromQuery] PropertyFilterModel filter)
        {
            filter.ThrowBadRequestIfNull($"The request must include a filter.");
            if (!filter.IsValid())
            {
                throw new BadRequestException("Property filter must contain valid values.");
            }

            var propertyNames = _pimsService.Property.GetNames((AllPropertyFilter)filter);

            return(new JsonResult(propertyNames));
        }
Esempio n. 3
0
        public IActionResult GetProperties([FromBody] PropertyFilterModel filter)
        {
            filter.ThrowBadRequestIfNull($"The request must include a filter.");
            if (!filter.IsValid())
            {
                throw new BadRequestException("Property filter must contain valid values.");
            }

            var page   = _pimsService.Property.GetPage((PropertyFilter)filter);
            var result = _mapper.Map <BModel.PageModel <Models.Search.PropertyModel> >(page);

            return(new JsonResult(result));
        }