public IList <ViewPost> GetViewPostTop() { //对图片路径做一个处理 IList <ViewPost> viewPosts = DbSession.PostDal.GetViewPostsTop(); viewPosts.ForEach(post => post.User.Head = ConvertPath.RelativeToAppLocation(post.User.Head)); return(viewPosts); }
public IList <ViewPost> GetViewPost(int pageindex, int boardid, out int pagecount) { int pageSize = PageSize.Value; List <ViewPost> list = DbSession.PostDal.GetViewPosts(pageindex, pageSize, boardid, out pagecount).ToList(); list.ForEach((post) => { post.User.Head = ConvertPath.RelativeToAppLocation(post.User.Head); }); return(list); }
public IList <ViewComment> GetViewCommentByPage(int postid, int pageindex, out int pagecount) { int pageSize = PageSize.Value; List <ViewComment> list = DbSession.CommentDal.GetViewComments(postid, pageindex, pageSize, out pagecount).ToList(); list.ForEach(x => { x.User.Head = ConvertPath.RelativeToAppLocation(x.User.Head); }); return(list); }
public ViewUserInfo GetViewUserInfo(int userid) { ViewUserInfo model = DbSession.UserDal.GetViewUserInfo(userid); if (null == model) { throw new UserException("未找到该用户相关信息"); } //转换路径 model.User.Head = ConvertPath.RelativeToAppLocation(model.User.Head); return(model); }
public ViewUser GetViewUser(UserSimp usersimp) { if (null == usersimp) { throw new ArgumentNullException("usersimp", "usersimp对象为null"); } ViewUser viewUser = new ViewUser(); viewUser.UserId = usersimp.UserId; viewUser.UserName = usersimp.UserName; //这里要进行一次路径的转换 viewUser.Head = ConvertPath.RelativeToAppLocation(usersimp.Head); return(viewUser); }