public User Get(string loginName, string password) { var neweggUser = WebRequestHelper.Request<NeweggUser>(string.Format(URL_GET_USER, loginName)); var user= new User { LoginName = loginName, Password = password, UserName = neweggUser.FullName, Email = neweggUser.Email, }; user.Avatar = GetAvater(user); return user; }
public override string GetAvatar(User user) { return GravatarHelper.GetImage(user.Email); }
private static Post CreatePost(User user, Group group) { return new Post() { PostId = Guid.NewGuid(), Url = "test", Title = "测试文章", Content = "<p>这是文章的正文内容.</p>", Description = "<p>这是文章的描述内容.</p>", PubAdmin = user, PubDate = DateTime.Now, Group = group, Tags = new List<Tag> {new Tag {Name = "Test Tag"}}, Categorys = new List<Category> { new Category { CategoryId = Guid.NewGuid(), Name = "default", Url = "default", Description = "这是一个默认分类.", OrderId = 1, Group = group, } }, }; }
public override string GetAvatar(User user) { return string.Format(URL_GET_USER_AVATAR, user.LoginName); }
public string GetAvater(User user) { return GravatarHelper.GetImage(user.Email); }
public string GetAvater(User user) { return string.Format(URL_GET_USER_AVATAR, user.LoginName ?? user.UserName); }
public virtual string GetAvatar(User user) { throw new NotImplementedException(); }
private static Post CreatePost(User user, Group group) { return new Post() { PostId = Guid.NewGuid(), Url = "test", Title = "Test article", Content = "<p>This is content.</p>", Description = "<p>This is description.</p>", CreateUser = user.UserName, PubDate = DateTime.Now, Group = group, Tags = new List<Tag> {new Tag {Name = "Test Tag"}}, }; }