public static int RetrieveUserId(string key)
        {
            var ctx = SharePointOnlineHelper.GetElevatedContext();

            using (ctx)
            {
                var user = ctx.Web.EnsureUser(key);
                ctx.Load(user);
                ctx.ExecuteQuery();
                return(user.Id);
            }
        }
        public static User GetUser(string key)

        {
            var ctx = SharePointOnlineHelper.GetElevatedContext();

            using (ctx)
            {
                var user = ctx.Web.EnsureUser(key);
                ctx.Load(user);
                ctx.ExecuteQuery();
                return(new User()
                {
                    value = user.LoginName, text = user.Title
                });
            }
        }