Ejemplo n.º 1
0
        /// <summary>
        /// 使用指定的用户名查询用户信息实体对象。
        /// </summary>
        /// <param name="username">要查询的用户名。</param>
        /// <returns>对应的用户信息实体对象。如果给定的用户名未在数据库中找到,返回 null。</returns>
        /// <exception cref="ArgumentNullException"/>
        public UserProfileEntity QueryUserProfileEntity(string username)
        {
            if (username == null)
            {
                throw new ArgumentNullException(nameof(username));
            }

            return(UserProfiles.Find(username));
        }
Ejemplo n.º 2
0
        public string GetIconById(string id)
        {
            var u = UserProfiles.Find((x) => x.Id.ToLower() == id.ToLower());

            if (u == null)
            {
                return(null);
            }
            return(u.Icon);
        }
Ejemplo n.º 3
0
        public string GetNameById(string id)
        {
            var u = UserProfiles.Find((x) => x.Id.ToLower() == id.ToLower());

            if (u == null)
            {
                return("Unknown");
            }
            return(u.Name);
        }
Ejemplo n.º 4
0
 public UserProfile GetById(string id)
 {
     return(UserProfiles.Find((x) => x.Id.ToLower() == id.ToLower()));
 }