예제 #1
0
        public async Task <ActionResult <UserProfile> > Post([FromServices] IUserProfileStore store, [FromBody] UserProfile card)
        {
            card.ID = null; // Users are horrible people, don't let them play hookie with the service
            var cardCreated = await store.StoreCardAsync(card);

            return(Created(Url.RouteUrl("GetCard.v1", new { id = cardCreated.ID }), cardCreated));
        }
예제 #2
0
 public async Task <ActionResult <UserProfile> > Put([FromServices] IUserProfileStore store, string id, [FromBody] UserProfile value)
 {
     value.ID = id;
     return(Ok(await store.StoreCardAsync(value)));
 }