よく使われるメソッド
よく使われるメソッド
よく使われるメソッド
よく使われるメソッド
public async Task <IActionResult> CreateNew([FromBody] PublicationCreateDto dto) { try { var user = await HttpContext.GetUser(); var result = await PublicationService.CreateNew(user.Id, dto); return(Created($"/api/Publication/{result.Id}", result)); } catch (Exception ex) { Logger.LogWarning(ex, "An error occured: " + ex.Message ?? "undefined"); return(ExceptionHandlerService.Handle(ex, Request)); } }