public async Task <SampleModel> UpdateSample(string id, [FromBody] SampleModelAttributes model) { var updatedModel = new SampleModel { Id = id, Name = model.Name, }; return(updatedModel); }
public async Task <ActionResult <SampleModel> > CreateSample([FromBody] SampleModelAttributes model) { var createdModel = new SampleModel { Id = IdGenerator.Generate(), Name = model.Name, }; return(CreatedAtAction(nameof(GetSample), new { version = "v1", id = createdModel.Id }, createdModel)); }