public async Task <HttpResponseMessage> Filter(string filter) { if (!ModelState.IsValid) { return(Request.CreateResponse(HttpStatusCode.BadRequest, "Invalid data")); } IEnumerable <VehicleModelServ> vehicleModelServs = await VehicleModelService.Filter(filter); List <VehicleModel> vehicleModels = new List <VehicleModel>(); vehicleModels = mapper.Map <IEnumerable <VehicleModelServ>, List <VehicleModel> >(vehicleModelServs); return(Request.CreateResponse(HttpStatusCode.OK, vehicleModels)); }