public async Task <IHttpActionResult> Patch(Foo foo) { await _service.Update(foo).ConfigureAwait(false); return(Ok()); }
public Task Update(Foo foo) { return(Task.CompletedTask); }
public async Task <IHttpActionResult> Post(Foo foo) { var newFoo = await _service.Add(foo).ConfigureAwait(false); return(CreatedAtRoute("GetById", new { newFoo.Id }, newFoo)); }
public Task <Foo> Add(Foo foo) { return(Task.FromResult(new Foo { Id = new Random().Next(), Value = foo.Value })); }