public IHttpActionResult PostDirection(IEnumerable <DirectionModel> directionModels) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var directions = new List <Direction>(); directions = ObjectFactory.Parse(directionModels, directions).ToList(); _directionService.AddList(directions); db.SaveChanges(); var newDirections = _directionService.GetDirections(directions); var newDirectionsModels = ModelFactory.Create(newDirections); return(Ok(newDirectionsModels)); }