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())); }
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)); }
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)); }