よく使われるメソッド
よく使われるメソッド
よく使われるメソッド
よく使われるメソッド
private async Task HandleTypedExceptionAsync(HttpContext context, TypedException exception) { var response = context.Response; var statusCode = (int)HttpStatusCode.OK; response.ContentType = "application/json"; response.StatusCode = statusCode; var responseObj = Mapper.Map <Response>(_exceptionService.GetResponseByExceptionType(exception)); responseObj.success = false; await response.WriteAsync(JsonConvert.SerializeObject(responseObj)); }