示例#1
0
        public bool Retrieve(int userId, out UserAuthor userAuthor)
        {
            if (_userAuthorCache.TryGetValue(userId, out userAuthor))
            {
                return(true);
            }

            userAuthor = new UserAuthor
            {
                UserId = userId
            };

            if (_userAuthorCache.TryAdd(userId, userAuthor))
            {
                return(false);
            }

            _userAuthorCache.TryGetValue(userId, out userAuthor);

            return(true);
        }
示例#2
0
 public Load(UserAuthor userAuthor, IBitmap avatar)
 {
     UserAuthor = userAuthor;
     Avatar     = avatar;
 }
示例#3
0
 public Load(UserAuthor userAuthor, string name)
 {
     UserAuthor = userAuthor;
     Name       = name;
 }