Ejemplo n.º 1
0
        public async Task <HttpResponseMessage> Filter(string filter)
        {
            if (!ModelState.IsValid)
            {
                return(Request.CreateResponse(HttpStatusCode.BadRequest, "Invalid data"));
            }

            IEnumerable <VehicleMakeServ> vehicleMakeServs = await VehicleMakeService.Filter(filter);

            List <VehicleMake> vehicleMakes = new List <VehicleMake>();

            vehicleMakes = mapper.Map <IEnumerable <VehicleMakeServ>, List <VehicleMake> >(vehicleMakeServs);
            return(Request.CreateResponse(HttpStatusCode.OK, vehicleMakes));
        }