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