public IActionResult SetNoteReminder(NoteReminder Reminder) { 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); Reminder.Id = Id; bool result = noteBL.SetNoteReminder(Reminder).Result; return(Ok(new { success = true, Message = "note reminder added" })); } return(BadRequest(new { success = false, Message = "no user is active please login" })); } catch (Exception exception) { return(BadRequest(new { success = false, exception.Message })); } }