コード例 #1
0
        /// <summary>
        /// Get the user name given the userid
        /// </summary>
        /// <param name="id">userid</param>
        /// <returns>username</returns>
        public string GetUserNameFromID(string id)
        {
            if (Globals.AccessOtherId() == id)
            {
                return(Globals.AccessOther());
            }

            string myname = _db.UserData
                            .FirstOrDefault(p => p.UserId == id)
                            ?.DisplayName;

            if (string.IsNullOrEmpty(myname))
            {
                return("??");
            }
            return(myname);
        }