public static IActionResult Run(
            [HttpTrigger(AuthorizationLevel.Function, "get", Route = "notificationcount/{id}")]
            HttpRequestMessage req,
            [CosmosDB(
                 databaseName: "contesthub",
                 collectionName: "NotificationLanding",
                 ConnectionStringSetting = "contesthub_DOCUMENTDB"
                 )]
            DocumentClient client,
            string id,
            TraceWriter log)
        {
            ///////2nd level Auth code
            //var jwtHandler = new JwtSecurityTokenHandler();
            //var jwtInput = req.Headers.Authorization.ToString();

            //var jwt = "";

            //if (jwtInput.Contains("Bearer"))
            //    jwt = jwtInput.Substring(7);
            //else
            //    jwt = jwtInput;



            //var readableToken = jwtHandler.CanReadToken(jwt);


            //var dId = "";
            //if (readableToken != true)
            //{
            //    return new NotFoundResult();
            //}
            //if (readableToken == true)
            //{
            //    var token = jwtHandler.ReadJwtToken(jwt);


            //    var claims = token.Claims;


            //    var claim = claims.Where(c => c.Type == "upn").FirstOrDefault();
            //    dId = claim.Value.Substring(0, claim.Value.IndexOf('@'));



            //}
            //if (dId.ToLower() != id.ToLower())
            //{
            //    return new UnauthorizedResult();
            //}
            log.Info($"Processed request for {id} in NotificationCount");

            Uri collectionUri = UriFactory.CreateDocumentCollectionUri("contesthub", "NotificationLanding");

            var count = client.CreateDocumentQuery <NotificationElement>(collectionUri, new FeedOptions {
                EnableCrossPartitionQuery = true
            })
                        .Where(d => d.logonid.ToUpper() == id.ToUpper())
                        .Where(d => d.isDeleted.ToLower() == "false")
                        .Where(d => d.isBellReset.ToLower() == "false")
                        .Count();


            //return expected result
            UnreadNotifications unreadNotifications = new UnreadNotifications(count.ToString());

            return(new OkObjectResult(new UnreadNotificationsResponse(unreadNotifications)));
        }
 public UnreadNotificationsResponse(UnreadNotifications unreadNotifications)
 {
     this.unreadNotifications = unreadNotifications;
 }