本文整理汇总了C#中ICommentService.GetTop20CommentsOfPublicGoalFollwing方法的典型用法代码示例。如果您正苦于以下问题:C# ICommentService.GetTop20CommentsOfPublicGoalFollwing方法的具体用法?C# ICommentService.GetTop20CommentsOfPublicGoalFollwing怎么用?C# ICommentService.GetTop20CommentsOfPublicGoalFollwing使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICommentService
的用法示例。
在下文中一共展示了ICommentService.GetTop20CommentsOfPublicGoalFollwing方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetNotifications
internal IEnumerable<NotificationsViewModel> GetNotifications(string userId, IGoalService goalService, ICommentService commentService, IUpdateService updateService, ISupportService supportService, IUserService userService, IGroupService groupService, IGroupUserService groupUserSevice, IGroupGoalService groupGoalService, IGroupCommentService groupcommentService, IGroupUpdateService groupupdateService, IFollowUserService followUserService, IGroupCommentUserService groupCommentUserService, ICommentUserService commentUserService, IGroupUpdateUserService groupUpdateUserService)
{
var goals = goalService.GetTop20GoalsofFollowing(userId);
var comments = commentService.GetTop20CommentsOfPublicGoalFollwing(userId);
var updates = updateService.GetTop20UpdatesOfFollowing(userId);
var groupusers = groupUserSevice.GetTop20GroupsUsers(userId);
var supports = supportService.GetTop20SupportsOfFollowings(userId);
var groupgoals = groupGoalService.GetTop20GroupsGoals(userId, groupUserSevice);
var groupupdates = groupupdateService.GetTop20Updates(userId, groupUserSevice);
var groupComments = groupcommentService.GetTop20CommentsOfPublicGoals(userId, groupUserSevice);
var followers = followUserService.GetTop20Followers(userId);
// var groups = groupService.GetTop20Groups(groupids);
return (from g in goals
select new NotificationsViewModel()
{
GoalId = g.GoalId,
UserId = g.UserId,
CreatedDate = g.CreatedDate,
UserName = g.User.UserName,
GoalName = g.GoalName,
Desc = g.Desc,
ProfilePicUrl = g.User.ProfilePicUrl,
Goal = g,
NotificationDate = DateCalculation(g.CreatedDate),
NotificationType = (int)NotificationType.createdGoal
})
.Concat(from c in comments
select new NotificationsViewModel()
{
CommentId = c.CommentId,
CreatedDate = c.CommentDate,
CommentText = c.CommentText,
UpdateId = c.UpdateId,
GoalName = c.Update.Goal.GoalName,
GoalId = c.Update.GoalId,
NumberOfComments = commentService.GetCommentsByUpdate(c.UpdateId).Count(),
Updatemsg = updateService.GetUpdate(c.UpdateId).Updatemsg,
NotificationDate = DateCalculation(c.CommentDate),
UserName = commentUserService.GetUser(c.CommentId).UserName,
UserId = commentUserService.GetUser(c.CommentId).Id,
ProfilePicUrl = commentUserService.GetUser(c.CommentId).ProfilePicUrl,
NotificationType = (int)NotificationType.commentedOnUpdate
})
.Concat(from u in updates
select new NotificationsViewModel()
{
Update = u,
UpdateId = u.UpdateId,
GoalId = u.GoalId,
ProfilePicUrl = u.Goal.User.ProfilePicUrl,
GoalName = u.Goal.GoalName,
Updatemsg = u.Updatemsg,
UserId = u.Goal.UserId,
UserName = u.Goal.User.UserName,
NumberOfComments = commentService.GetCommentsByUpdate(u.UpdateId).Count(),
CreatedDate = u.UpdateDate,
NotificationDate = DateCalculation(u.UpdateDate),
NotificationType = (int)NotificationType.updatedGoal
})
.Concat(from gr in groupgoals
select new NotificationsViewModel()
{
GroupGoalId = gr.GroupGoalId,
CreatedDate = gr.CreatedDate,
UserId = gr.GroupUser.UserId,
UserName = userService.GetUser(gr.GroupUser.UserId).UserName,
ProfilePicUrl = userService.GetUser(gr.GroupUser.UserId).ProfilePicUrl,
GroupName = gr.Group.GroupName,
GroupGoalName = gr.GoalName,
GroupId = gr.GroupId,
NotificationDate = DateCalculation(gr.CreatedDate),
NotificationType = (int)NotificationType.createGroup
})
.Concat(from gu in groupusers
select new NotificationsViewModel()
{
GroupUser = gu,
GroupUserId = gu.GroupUserId,
UserId = gu.UserId,
UserName = userService.GetUser(gu.UserId).UserName,
ProfilePicUrl = userService.GetUser(gu.UserId).ProfilePicUrl,
GroupName = groupService.GetGroup(gu.GroupId).GroupName,
GroupId = gu.GroupId,
CreatedDate = gu.AddedDate,
NotificationDate = DateCalculation(gu.AddedDate),
NotificationType = (int)NotificationType.joinGroup
})
.Concat(from s in supports
select new NotificationsViewModel()
{
Support = s,
SupportId = s.SupportId,
//.........这里部分代码省略.........