public IHttpActionResult GetProperties([FromUri] PropertyListRequest requestParams) { loggedInUser = GetLoggedInUser(); if (requestParams == null) { return BadRequest("Property list request parameters are missing"); } var result = new PropertyListRequestValidator().Validate(requestParams); if (!result.IsValid) { return new ValidatorError("Error validating page request parameters", HttpStatusCode.BadRequest, result, Request); } // Get properties based on parameters we got var paginatedList = GetPaginatedPropertyList(requestParams); return Ok(paginatedList); }
public IHttpActionResult GetProperties([FromUri] PropertyListRequest requestParams) { loggedInUser = GetLoggedInUser(); if (requestParams == null) { return(BadRequest("Property list request parameters are missing")); } var result = new PropertyListRequestValidator().Validate(requestParams); if (!result.IsValid) { return(new ValidatorError("Error validating page request parameters", HttpStatusCode.BadRequest, result, Request)); } // Get properties based on parameters we got var paginatedList = GetPaginatedPropertyList(requestParams); return(Ok(paginatedList)); }