public async Task <TalkVm> AddTalkAsync(TalkVm talk) { var result = await _talkService.AddTalkAsync(talk).ConfigureAwait(false); _cache.Remove(nameof(GetAllTalksAsync)); return(result); }
public async Task <IActionResult> AddTalk([FromBody] TalkDTO talkDTO) { try { if (talkDTO == null) { return(BadRequest(new ApiResponse { Status = false, Message = "Bad Request" })); } await _talkService.AddTalkAsync(talkDTO); } catch (Exception ex) { _logger.LogError(ex.Message, $"Failed to add Talk: {DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ss.fff")}"); } _logger.LogInformation("Successfully added Talk"); return(Created("", new ApiResponse { Status = true, Message = "Successful" })); }
public Task <TalkVm> AddTalk([FromBody] TalkVm talk) => _talkService.AddTalkAsync(talk);