public AuthRegisterRequestValidator(IGoalService goalService)
        {
            RuleFor(x => x.Email)
            .NotEmpty()
            .EmailAddress();

            RuleFor(x => x.Password)
            .SetValidator(new PasswordRule());

            RuleFor(x => x.ConfirmPassword)
            .NotEmpty()
            .Equal(x => x.Password).WithMessage("Podane hasła nie są identyczne");

            RuleFor(x => x.Name)
            .NotEmpty();

            RuleFor(x => x.Surname)
            .NotEmpty();

            RuleFor(x => x.GoalId)
            .NotEmpty().WithMessage("Podaj poprwany cel ćwiczenia")
            .DependentRules(() =>
            {
                RuleFor(x => x.GoalId)
                .Must(roleId => goalService.GoalExists(roleId))
                .WithMessage("Podany cel nie istnieje");
            });
        }
Exemplo n.º 2
0
 public CalendarController(ICalendarService calendarService, IEventService eventService, IHabitService habitService, UserManager <ApplicationUser> signInManager, IGoalService goalService)
 {
     this.calendarService = calendarService;
     this.eventService    = eventService;
     this.habitService    = habitService;
     this.signInManager   = signInManager;
     this.goalService     = goalService;
 }
Exemplo n.º 3
0
 public EndOfDayReportService(IEndOfDayReportRepository endOfDayReportRepository, IFeedEventService feedEventService, IGoalService goalService, IUserService userService, IActivityRepository activityRepository, IUnitOfWork unit)
 {
     _endOfDayReportRepository = endOfDayReportRepository;
     _feedEventService         = feedEventService;
     _goalService        = goalService;
     _userService        = userService;
     _activityRepository = activityRepository;
     _unit = unit;
 }
Exemplo n.º 4
0
 public GoalController(
     IGoalService goalService,
     IGoalMapper goalMapper)
 {
     GoalService = goalService
                   ?? throw new ArgumentNullException(nameof(goalService));
     GoalMapper = goalMapper
                  ?? throw new ArgumentNullException(nameof(goalMapper));
 }
Exemplo n.º 5
0
 public ActivityService(IActivityRepository activityRepository, IGoalService goalService, IFeedEventService feedEventService, IUserService userService, IUserBadgeService userBadgeService, IUnitOfWork unit)
 {
     _activityRepository = activityRepository;
     _goalService        = goalService;
     _feedEventService   = feedEventService;
     _userService        = userService;
     _userBadgeService   = userBadgeService;
     _unit = unit;
 }
Exemplo n.º 6
0
 public GoalController(
     IHttpContextAccessor httpContextAccessor,
     IAccountService accountService,
     IGoalService goalService
     )
 {
     _httpContextAccessor = httpContextAccessor;
     _accountService      = accountService;
     _goalService         = goalService;
 }
 public NotificationController(IGoalService goalService, IUpdateService updateService, ICommentService commentService, IGroupInvitationService groupInvitationService, ISupportInvitationService supportInvitationService, IFollowRequestService followRequestService, IUserService userService)
 {
     this.goalService = goalService;
     this.supportInvitationService = supportInvitationService;
     this.updateService            = updateService;
     this.groupInvitationService   = groupInvitationService;
     this.commentService           = commentService;
     this.followRequestService     = followRequestService;
     this.userService = userService;
 }
 public NotificationController(IGoalService goalService, IUpdateService updateService, ICommentService commentService, IGroupInvitationService groupInvitationService, ISupportInvitationService supportInvitationService, IFollowRequestService followRequestService, IUserService userService)
 {
     this.goalService = goalService;
     this.supportInvitationService = supportInvitationService;
     this.updateService = updateService;
     this.groupInvitationService = groupInvitationService;
     this.commentService = commentService;
     this.followRequestService = followRequestService;
     this.userService = userService;
 }
Exemplo n.º 9
0
 public GoalManager(
     IGoalService goalService,
     IMapper mapper,
     IProjectService projectService,
     IQuizService quizService)
 {
     this.goalService    = goalService;
     this.mapper         = mapper;
     this.projectService = projectService;
     this.quizService    = quizService;
 }
Exemplo n.º 10
0
 public AuthenticationManager(
     IUserService userService,
     IGoalService goalService,
     IProjectService projectService,
     IMapper mapper)
 {
     this.userService    = userService;
     this.goalService    = goalService;
     this.projectService = projectService;
     this.mapper         = mapper;
 }
Exemplo n.º 11
0
 public GoalsController(IMapper mapper,
                        IPlayerService playerService,
                        ISquadService squadService,
                        IMatchService matchService,
                        IGoalService goalService)
 {
     _mapper        = mapper;
     _playerService = playerService;
     _squadService  = squadService;
     _matchService  = matchService;
     _goalService   = goalService;
 }
Exemplo n.º 12
0
 public AccountController(IUserService userService, IUserProfileService userProfileService, IGoalService goalService, IUpdateService updateService, ICommentService commentService, IFollowRequestService followRequestService, IFollowUserService followUserService, ISecurityTokenService securityTokenService, UserManager<ApplicationUser> userManager)
 {
     this.userService = userService;
     this.userProfileService = userProfileService;
     this.goalService = goalService;
     this.updateService = updateService;
     this.commentService = commentService;
     this.followRequestService = followRequestService;
     this.followUserService = followUserService;
     this.securityTokenService = securityTokenService;
     this.UserManager = userManager;
 }
Exemplo n.º 13
0
 public CampaignController(
     ICampaignService campaignService,
     IGoalService goalService,
     ICampaignGoalService campaignGoalService,
     IMapper mapper
     )
 {
     _campaignService     = campaignService;
     _goalService         = goalService;
     _campaignGoalService = campaignGoalService;
     _mapper = mapper;
 }
Exemplo n.º 14
0
 public AccountController(IUserService userService, IUserProfileService userProfileService, IGoalService goalService, IUpdateService updateService, ICommentService commentService, IFollowRequestService followRequestService, IFollowUserService followUserService, ISecurityTokenService securityTokenService, UserManager <ApplicationUser> userManager)
 {
     this.userService          = userService;
     this.userProfileService   = userProfileService;
     this.goalService          = goalService;
     this.updateService        = updateService;
     this.commentService       = commentService;
     this.followRequestService = followRequestService;
     this.followUserService    = followUserService;
     this.securityTokenService = securityTokenService;
     this.UserManager          = userManager;
 }
Exemplo n.º 15
0
 public JobManager(
     IMapper mapper,
     IJobService jobService,
     IGoalService goalService,
     IProjectService projectService,
     IQuizService quizService)
 {
     this.mapper         = mapper;
     this.jobService     = jobService;
     this.goalService    = goalService;
     this.projectService = projectService;
     this.quizService    = quizService;
 }
Exemplo n.º 16
0
        public void SetUp()
        {
            goalRepository = new Mock<IGoalRepository>();
            userRepository = new Mock<IUserRepository>();
            groupRepository = new Mock<IGroupRepository>();
            followUserRepository = new Mock<IFollowUserRepository>();
            groupUserRepository = new Mock<IGroupUserRepository>();
            userProfileRepository = new Mock<IUserProfileRepository>();
            unitOfWork = new Mock<IUnitOfWork>();

            goalService = new GoalService(goalRepository.Object, followUserRepository.Object, unitOfWork.Object);
            groupService = new GroupService(groupRepository.Object, followUserRepository.Object, groupUserRepository.Object, unitOfWork.Object);
            userService = new UserService(userRepository.Object, unitOfWork.Object, userProfileRepository.Object);
        }
Exemplo n.º 17
0
        public void SetUp()
        {
            goalRepository        = new Mock <IGoalRepository>();
            userRepository        = new Mock <IUserRepository>();
            groupRepository       = new Mock <IGroupRepository>();
            followUserRepository  = new Mock <IFollowUserRepository>();
            groupUserRepository   = new Mock <IGroupUserRepository>();
            userProfileRepository = new Mock <IUserProfileRepository>();
            unitOfWork            = new Mock <IUnitOfWork>();

            goalService  = new GoalService(goalRepository.Object, followUserRepository.Object, unitOfWork.Object);
            groupService = new GroupService(groupRepository.Object, followUserRepository.Object, groupUserRepository.Object, unitOfWork.Object);
            userService  = new UserService(userRepository.Object, unitOfWork.Object, userProfileRepository.Object);
        }
Exemplo n.º 18
0
 public GoalController(IGoalService goalService, IMetricService metricService, IFocusService focusService, ISupportService supportService, IUpdateService updateService, ICommentService commentService, IUserService userService, ISecurityTokenService securityTokenService, ISupportInvitationService supportInvitationService, IGoalStatusService goalStatusService, ICommentUserService commentUserService, IUpdateSupportService updateSupportService)
 {
     this.goalService = goalService;
     this.supportInvitationService = supportInvitationService;
     this.metricService            = metricService;
     this.focusService             = focusService;
     this.supportService           = supportService;
     this.updateService            = updateService;
     this.commentService           = commentService;
     this.userService          = userService;
     this.securityTokenService = securityTokenService;
     this.goalStatusService    = goalStatusService;
     this.commentUserService   = commentUserService;
     this.updateSupportService = updateSupportService;
 }
Exemplo n.º 19
0
        static Program()
        {
            Scope                 = CompositionRoot.GetBuilder.BeginLifetimeScope();
            Dispatcher            = new Dispatcher();
            NotificationConverter = new NotificationConverter();
            //  Services
            NotificacionBoardService = Scope.Resolve <INotificationBoardService>();
            NotificacionService      = Scope.Resolve <INotificationService>();

            GoalDebtService      = Scope.Resolve <IGoalService <Debt> >();
            GoalSavingService    = Scope.Resolve <IGoalService <Saving> >();
            GoalRecurrentService = Scope.Resolve <IGoalService <Recurrent> >();

            UserService = Scope.Resolve <IUserService>();
        }
Exemplo n.º 20
0
 public GoalController(IGoalService goalService, IMetricService metricService, IFocusService focusService, ISupportService supportService, IUpdateService updateService, ICommentService commentService, IUserService userService, ISecurityTokenService securityTokenService, ISupportInvitationService supportInvitationService, IGoalStatusService goalStatusService, ICommentUserService commentUserService, IUpdateSupportService updateSupportService)
 {
     this.goalService = goalService;
     this.supportInvitationService = supportInvitationService;
     this.metricService = metricService;
     this.focusService = focusService;
     this.supportService = supportService;
     this.updateService = updateService;
     this.commentService = commentService;
     this.userService = userService;
     this.securityTokenService = securityTokenService;
     this.goalStatusService = goalStatusService;
     this.commentUserService = commentUserService;
     this.updateSupportService = updateSupportService;
 }
Exemplo n.º 21
0
 public PaymentController(
     IUserService userService,
     IMolliePaymentService paymentService,
     IGoalService goalService,
     ISubgoalService subgoalService,
     IMapper mapper,
     ILogger <PaymentController> logger
     )
 {
     _userService    = userService;
     _paymentService = paymentService;
     _goalService    = goalService;
     _subgoalService = subgoalService;
     _mapper         = mapper;
     _logger         = logger;
 }
Exemplo n.º 22
0
 public TemplateController(
     IHttpContextAccessor httpContextAccessor,
     ITemplateService templateService,
     ICategoryService categoryService,
     ITransactionService transactionService,
     IAccountService accountService,
     IGoalService goalService
     )
 {
     _httpContextAccessor = httpContextAccessor;
     _templateService     = templateService;
     _categoryService     = categoryService;
     _transactionService  = transactionService;
     _accountService      = accountService;
     _goalService         = goalService;
 }
Exemplo n.º 23
0
 public TransactionController(
     IHttpContextAccessor httpContextAccessor,
     ICategoryService categoryService,
     ITransactionService transactionService,
     IAccountService accountService,
     IGoalService goalService,
     IAutoOperationsService autoOperationsService,
     IExcelExportService excelExportService
     )
 {
     _httpContextAccessor   = httpContextAccessor;
     _categoryService       = categoryService;
     _transactionService    = transactionService;
     _accountService        = accountService;
     _goalService           = goalService;
     _autoOperationsService = autoOperationsService;
     _excelExportService    = excelExportService;
 }
Exemplo n.º 24
0
 public HomeController(IMetricService metricService, IFocusService focusService, IGoalService goalService, ICommentService commentService, IUpdateService updateService, ISupportService supportService, IUserService userService, IGroupUserService groupUserService, IGroupService groupService, IGroupGoalService groupGoalService, IGroupUpdateService groupupdateService, IGroupCommentService groupcommentService, IFollowUserService followUserService, IGroupUpdateUserService groupUpdateUserService, IGroupCommentUserService groupCommentUserService, ICommentUserService commentUserService)
 {
     this.metricService = metricService;
     this.focusService = focusService;
     this.goalService = goalService;
     this.commentService = commentService;
     this.updateService = updateService;
     this.supportService = supportService;
     this.userService = userService;
     this.groupService = groupService;
     this.groupUserService = groupUserService;
     this.groupGoalService = groupGoalService;
     this.groupupdateService = groupupdateService;
     this.groupcommentService = groupcommentService;
     this.followUserService = followUserService;
     this.groupCommentUserService = groupCommentUserService;
     this.groupUpdateUserService = groupUpdateUserService;
     this.commentUserService = commentUserService;
 }
        public UpdateUserRequestValidator(IGoalService goalService)
        {
            RuleFor(x => x.Name)
            .NotEmpty()
            .MaximumLength(60);

            RuleFor(x => x.Surname)
            .NotEmpty()
            .MaximumLength(60);

            RuleFor(x => x.GoalId)
            .NotEmpty().WithMessage("Podaj poprwany cel ćwiczenia")
            .DependentRules(() =>
            {
                RuleFor(x => x.GoalId)
                .Must(roleId => goalService.GoalExists(roleId))
                .WithMessage("Podany cel nie istnieje");
            });
        }
Exemplo n.º 26
0
 public HomeController(IMetricService metricService, IFocusService focusService, IGoalService goalService, ICommentService commentService, IUpdateService updateService, ISupportService supportService, IUserService userService, IGroupUserService groupUserService, IGroupService groupService, IGroupGoalService groupGoalService, IGroupUpdateService groupupdateService, IGroupCommentService groupcommentService, IFollowUserService followUserService, IGroupUpdateUserService groupUpdateUserService, IGroupCommentUserService groupCommentUserService, ICommentUserService commentUserService)
 {
     this.metricService           = metricService;
     this.focusService            = focusService;
     this.goalService             = goalService;
     this.commentService          = commentService;
     this.updateService           = updateService;
     this.supportService          = supportService;
     this.userService             = userService;
     this.groupService            = groupService;
     this.groupUserService        = groupUserService;
     this.groupGoalService        = groupGoalService;
     this.groupupdateService      = groupupdateService;
     this.groupcommentService     = groupcommentService;
     this.followUserService       = followUserService;
     this.groupCommentUserService = groupCommentUserService;
     this.groupUpdateUserService  = groupUpdateUserService;
     this.commentUserService      = commentUserService;
 }
Exemplo n.º 27
0
 public TransactionService(
     IRepository <Transaction> transactionRepository,
     IUserService userService,
     IMapper mapper,
     IAccountService accountService,
     IBudgetService budgetService,
     IGoalService goalService,
     IInvestmentService investmentService,
     IPaymentService paymentService
     )
 {
     this._transactionRepository = transactionRepository;
     this._userService           = userService;
     this._mapper            = mapper;
     this._accountService    = accountService;
     this._budgetService     = budgetService;
     this._goalService       = goalService;
     this._investmentService = investmentService;
     this._paymentService    = paymentService;
 }
Exemplo n.º 28
0
        public IEnumerable<Goal> GetUserSupportedGoalsBYPopularity(string userid, IGoalService goalService)
        {
            return GetSupports().Where(s => s.UserId == userid).Join(goalService.GetGoals(), s => s.GoalId, g => g.GoalId, (s, g) => g).OrderByDescending(g => g.Supports.Count()).ToList();

        }
Exemplo n.º 29
0
        internal IEnumerable<NotificationsViewModel> GetProfileNotifications(string userid, IGoalService goalService, ICommentService commentService, IUpdateService updateService, ISupportService supportService, IUserService userService, IGroupService groupService, IGroupUserService groupUserSevice, IGroupGoalService groupGoalService, IGroupCommentService groupcommentService, IGroupUpdateService groupupdateService, ICommentUserService commentUserService)
        {
            var goals = goalService.GetTop20Goals(userid);
            var comments = commentService.GetTop20CommentsOfPublicGoals(userid);
            var updates = updateService.GetTop20Updates(userid);
            var groupusers = groupUserSevice.GetTop20GroupsUsersForProfile(userid);
            var supports = supportService.GetTop20Support(userid);

            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,

                                UserName = commentUserService.GetUser(c.CommentId).UserName,
                                UserId = commentUserService.GetUser(c.CommentId).Id,
                                ProfilePicUrl = commentUserService.GetUser(c.CommentId).ProfilePicUrl,

                                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),
                                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 s in supports
                            select new NotificationsViewModel()
                            {
                                Support = s,
                                SupportId = s.SupportId,
                                GoalName = s.Goal.GoalName,

                                ProfilePicUrl = userService.GetUser(s.UserId).ProfilePicUrl,
                                UserName = userService.GetUser(s.UserId).UserName,
                                UserId = s.UserId,

                                CreatedDate = s.SupportedDate,
                                GoalId = s.GoalId,
                                NotificationType = (int)NotificationType.supportGoal
                            })
                    .Concat(from gu in groupusers
                            select new NotificationsViewModel()
                            {
                                GroupUser = gu,

                                GroupUserId = gu.GroupUserId,

                                UserName = userService.GetUser(gu.UserId).UserName,
                                ProfilePicUrl = userService.GetUser(gu.UserId).ProfilePicUrl,
                                UserId = gu.UserId,

                                GroupName = groupService.GetGroup(gu.GroupId).GroupName,
                                GroupId = gu.GroupId,
                                CreatedDate = gu.AddedDate,
                                NotificationDate = DateCalculation(gu.AddedDate),
                                NotificationType = (int)NotificationType.joinGroup
                            })
                                                        .OrderByDescending(n => n.CreatedDate);
        }
Exemplo n.º 30
0
 public IEnumerable <Goal> GetUserSupportedGoalsByPopularity(string userid, IGoalService goalService)
 {
     return(GetSupports().Where(s => s.UserId == userid).Join(goalService.GetGoals(), s => s.GoalId, g => g.GoalId, (s, g) => g).OrderByDescending(g => g.Supports.Count()).ToList());
 }
Exemplo n.º 31
0
 public GoalController(ToDoContext context, IGoalService goalService, IUnitOfWork unitOfWork)
 {
     _context     = context;
     _goalService = goalService;
     _unitOfWork  = unitOfWork;
 }
Exemplo n.º 32
0
 public SearchController(IGoalService goalService, IUserService userService, IGroupService groupService)
 {
     this.goalService  = goalService;
     this.userService  = userService;
     this.groupService = groupService;
 }
Exemplo n.º 33
0
 protected GoalService(IGoalService <T> service)
 {
     _service = service;
 }
Exemplo n.º 34
0
 public GoalsController(IGoalService goalService, UserManager <ApplicationUser> userManager, IHabitService habitService)
 {
     this.goalService  = goalService;
     this.userManager  = userManager;
     this.habitService = habitService;
 }
Exemplo n.º 35
0
 public SearchController(IGoalService goalService, IUserService userService, IGroupService groupService)
 {
     this.goalService = goalService;
     this.userService = userService;
     this.groupService = groupService;
 }
Exemplo n.º 36
0
 public GoalTypeController(IGoalService goalService)
 {
     _goalService = goalService;
 }
 public UserGoalController(IGoalService goalService)
 {
     _goalService = goalService;
 }
Exemplo n.º 38
0
        public void SetUp()
        {
            goalRepository = new Mock<IGoalRepository>();
            followuserRepository = new Mock<IFollowUserRepository>();
            supportRepository = new Mock<ISupportRepository>();
            goalStatusRepository = new Mock<IGoalStatusRepository>();
            focusRepository = new Mock<IFocusRepository>();
            metricRepository = new Mock<IMetricRepository>();
            updateRepository = new Mock<IUpdateRepository>();
            userRepository = new Mock<IUserRepository>();
            supportrepository = new Mock<ISupportRepository>();
            supportInvitationrepository = new Mock<ISupportInvitationRepository>();
            commentRepository = new Mock<ICommentRepository>();
            commentUserRepository = new Mock<ICommentUserRepository>();
            securityTokenrepository = new Mock<ISecurityTokenRepository>();
            userProfileRepository = new Mock<IUserProfileRepository>();
            updateSupportRepository = new Mock<IUpdateSupportRepository>();

            userMailer = new Mock<IUserMailer>();
            userMailerMock = new Mock<UserMailer>();
            mailerBase = new Mock<MailerBase>();
            unitOfWork = new Mock<IUnitOfWork>();

            goalService = new GoalService(goalRepository.Object, followuserRepository.Object, unitOfWork.Object);
            supportService = new SupportService(supportRepository.Object, followuserRepository.Object, unitOfWork.Object);
            goalStatusService = new GoalStatusService(goalStatusRepository.Object, unitOfWork.Object);
            focusService = new FocusService(focusRepository.Object, unitOfWork.Object);
            metricService = new MetricService(metricRepository.Object, unitOfWork.Object);
            updateService = new UpdateService(updateRepository.Object, goalRepository.Object, unitOfWork.Object, followuserRepository.Object);
            userService = new UserService(userRepository.Object, unitOfWork.Object, userProfileRepository.Object);
            supportService = new SupportService(supportrepository.Object, followuserRepository.Object, unitOfWork.Object);
            supportInvitationService = new SupportInvitationService(supportInvitationrepository.Object, unitOfWork.Object);
            commentService = new CommentService(commentRepository.Object, commentUserRepository.Object, unitOfWork.Object, followuserRepository.Object);
            commentUserService = new CommentUserService(commentUserRepository.Object, userRepository.Object, unitOfWork.Object);
            securityTokenService = new SecurityTokenService(securityTokenrepository.Object, unitOfWork.Object);
            userProfileService = new UserProfileService(userProfileRepository.Object, unitOfWork.Object);
            updateSupportService = new UpdateSupportService(updateSupportRepository.Object, unitOfWork.Object);

            MailerBase.IsTestModeEnabled = true;
            userMailerMock.CallBase = true;

            controllerContext = new Mock<ControllerContext>();
            contextBase = new Mock<HttpContextBase>();
            httpRequest = new Mock<HttpRequestBase>();
            httpResponse = new Mock<HttpResponseBase>();
            genericPrincipal = new Mock<GenericPrincipal>();

            identity = new Mock<IIdentity>();
            principal = new Mock<IPrincipal>();
        }
Exemplo n.º 39
0
 public GoalsController(IGoalService <GoalYear> goalYearService, IGoalService <GoalWeek> goalWeekService, IGoalService <GoalDay> goalDayService)
 {
     _goalYearService = goalYearService;
     _goalWeekService = goalWeekService;
     _goalDayService  = goalDayService;
 }
Exemplo n.º 40
0
        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,
                                GoalName = s.Goal.GoalName,

                                ProfilePicUrl = userService.GetUser(s.UserId).ProfilePicUrl,
                                UserName = userService.GetUser(s.UserId).UserName,
                                UserId = s.UserId,
                                CreatedDate = s.SupportedDate,
                                GoalId = s.GoalId,
                                NotificationDate = DateCalculation(s.SupportedDate),
                                NotificationType = (int)NotificationType.supportGoal
                            })
                    .Concat(from gu in groupupdates
                            select new NotificationsViewModel()
                            {
                                GroupUpdate = gu,
                                GroupUpdateId = gu.GroupUpdateId,
                                GroupUpdatemsg = gu.Updatemsg,

                                UserId = groupUpdateUserService.GetGroupUpdateUser(gu.GroupUpdateId).Id,
                                ProfilePicUrl = groupUpdateUserService.GetGroupUpdateUser(gu.GroupUpdateId).ProfilePicUrl,
                                UserName = groupUpdateUserService.GetGroupUpdateUser(gu.GroupUpdateId).UserName,
                                NotificationDate = DateCalculation(gu.UpdateDate),
                                CreatedDate = gu.UpdateDate,
                                GroupGoalId = gu.GroupGoalId,
                                GroupId = gu.GroupGoal.GroupId,
                                GroupGoalName = gu.GroupGoal.GoalName,
                                GroupName = gu.GroupGoal.Group.GroupName,
                                NotificationType = (int)NotificationType.updatedGroupgoal

                            })
                    .Concat(from gc in groupComments
                            select new NotificationsViewModel()
                            {

                                GroupCommentId = gc.GroupCommentId,
                                GroupCommentText = gc.CommentText,
                                GroupUpdateId = gc.GroupUpdateId,

                                GroupGoalId = gc.GroupUpdate.GroupGoalId,
                                GroupGoalName = gc.GroupUpdate.GroupGoal.GoalName,

                                UserId = groupCommentUserService.GetGroupCommentUser(gc.GroupCommentId).Id,
                                UserName = groupCommentUserService.GetGroupCommentUser(gc.GroupCommentId).UserName,
                                ProfilePicUrl = groupCommentUserService.GetGroupCommentUser(gc.GroupCommentId).ProfilePicUrl,

                                GroupUpdatemsg = gc.GroupUpdate.Updatemsg,
                                GroupId = gc.GroupUpdate.GroupGoal.GroupUser.GroupId,
                                GroupName = gc.GroupUpdate.GroupGoal.Group.GroupName,
                                NotificationDate = DateCalculation(gc.CommentDate),
                                CreatedDate = gc.CommentDate,
                                NotificationType = (int)NotificationType.commentedonGroupUdate
                            })
                    .Concat(from f in followers
                            select new NotificationsViewModel()
                            {
                                FollowUserId = f.FollowUserId,
                                FromUser = f.FromUser,
                                ToUser = f.ToUser,
                                ProfilePicUrl = f.FromUser.ProfilePicUrl,
                                FromUserId = f.FromUserId,
                                ToUserId = f.ToUserId,
                                CreatedDate = f.AddedDate,
                                NotificationDate = DateCalculation(f.AddedDate),
                                NotificationType = (int)NotificationType.followUser
                            }).OrderByDescending(n => n.CreatedDate);
        }