コード例 #1
0
        public async Task <IActionResult> Contact([FromRoute(Name = "id")] Guid contactId, [FromBody] DemandDto demand)
        {
            try
            {
                var myId   = ExtractIdFromToken(Request.Headers[HttpRequestHeader.Authorization.ToString()]);
                var result = await service.Contact(myId, contactId, demand);

                return(Created($"/api/contacts/{result.Data.Id}", result));
            }
            catch (HttpResponseException)
            {
                throw;
            }
            catch (Exception)
            {
                throw new BadRequestApiException();
            }
        }