public IActionResult GetActiveNotes() { try { var identity = User.Identity as ClaimsIdentity; if (identity != null) { IEnumerable <Claim> claims = identity.Claims; long Id = Convert.ToInt64(claims.Where(p => p.Type == "Id").FirstOrDefault()?.Value); string EmailAddress = claims.Where(p => p.Type == "EmailAddress").FirstOrDefault()?.Value; var result = noteBL.GetActiveNotes(Id); return(Ok(new { success = true, user = EmailAddress, Notes = result })); } return(BadRequest(new { success = false, Message = "no user is active please login" })); } catch (Exception exception) { return(BadRequest(new { success = false, exception.InnerException })); } }