public async Task <IActionResult> DisplayNotes() { try { var userId = TokenUserId(); if (userId != 0) { IList <DisplayResponceModel> Data = await note.DisplayNotes(userId); if (Data.Count != 0) { return(Ok(new { success = true, Meassage = "Display notes operation is successful", Data })); } else { return(BadRequest(new { success = false, Meassage = "Display notes operation is not successful" })); } } else { return(BadRequest(new { success = false, Meassage = "Invalid user" })); } } catch (Exception e) { // return BadRequest(new { success = false, Meassage = e.Message }); return(new StatusCodeResult(StatusCodes.Status500InternalServerError)); } }