public async Task <IActionResult> Create([FromBody] Model model) { if (model == null) { return(BadRequest()); } if (model.ModelName == null || model.Mark == null) { return(BadRequest()); } Model added = await modelRepository.CreateAsync(model); return(CreatedAtRoute("GetModel", new { id = added.Id }, model)); }