예제 #1
0
        public async Task <IHttpActionResult> Patch(Foo foo)
        {
            await _service.Update(foo).ConfigureAwait(false);

            return(Ok());
        }
예제 #2
0
 public Task Update(Foo foo)
 {
     return(Task.CompletedTask);
 }
예제 #3
0
        public async Task <IHttpActionResult> Post(Foo foo)
        {
            var newFoo = await _service.Add(foo).ConfigureAwait(false);

            return(CreatedAtRoute("GetById", new { newFoo.Id }, newFoo));
        }
예제 #4
0
 public Task <Foo> Add(Foo foo)
 {
     return(Task.FromResult(new Foo {
         Id = new Random().Next(), Value = foo.Value
     }));
 }