public async Task <IActionResult> Post([FromBody] CreateDiaryDTO entity) { entity.EnteredBy = entity.UserId = User.Claims.FirstOrDefault(a => a.Type.Contains("sid")).Value; if (await _diaryService.Create(entity) > 0) { return(Ok()); } return(BadRequest()); }