/// <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)); }
public string GetIconById(string id) { var u = UserProfiles.Find((x) => x.Id.ToLower() == id.ToLower()); if (u == null) { return(null); } return(u.Icon); }
public string GetNameById(string id) { var u = UserProfiles.Find((x) => x.Id.ToLower() == id.ToLower()); if (u == null) { return("Unknown"); } return(u.Name); }
public UserProfile GetById(string id) { return(UserProfiles.Find((x) => x.Id.ToLower() == id.ToLower())); }