Esempio n. 1
0
        public WorkController(
            AppSettings appSettings,
            IIterationsApiService iterationsApi,
            IWorkApiService workApi,
            ITeamsApiService teamsApi,
            WorkActivityAppService workActivityAppService,
            WorkIterationAppService workIterationAppService)
            : base(appSettings, workApi)
        {
            if (appSettings == null)
            {
                throw new ArgumentNullException(nameof(appSettings));
            }
            if (workApi == null)
            {
                throw new ArgumentNullException(nameof(workApi));
            }

            _iterationsApi          = iterationsApi ?? throw new ArgumentNullException(nameof(iterationsApi));
            _teamsApi               = teamsApi ?? throw new ArgumentNullException(nameof(teamsApi));
            _workActivityAppService = workActivityAppService ??
                                      throw new ArgumentNullException(nameof(workActivityAppService));
            _workIterationAppService = workIterationAppService ??
                                       throw new ArgumentNullException(nameof(workIterationAppService));
        }
 public WorkLeaderboardAppService(
     IIterationsApiService iterationsApi,
     ITeamsApiService teamsApi,
     WorkIterationAppService workIterationAppService)
 {
     _iterationsApi           = iterationsApi ?? throw new ArgumentNullException(nameof(iterationsApi));
     _teamsApi                = teamsApi ?? throw new ArgumentNullException(nameof(teamsApi));
     _workIterationAppService = workIterationAppService ??
                                throw new ArgumentNullException(nameof(workIterationAppService));
 }
 public WorkActivityAppService(
     ICache cache,
     IGitApiService gitApi,
     IIterationsApiService iterationsApi,
     ITeamsApiService teamsApi,
     WorkIterationAppService workIterationAppService)
 {
     _cache                   = cache ?? throw new ArgumentNullException(nameof(cache));
     _gitApi                  = gitApi ?? throw new ArgumentNullException(nameof(gitApi));
     _iterationsApi           = iterationsApi ?? throw new ArgumentNullException(nameof(iterationsApi));
     _teamsApi                = teamsApi ?? throw new ArgumentNullException(nameof(teamsApi));
     _workIterationAppService = workIterationAppService ??
                                throw new ArgumentNullException(nameof(workIterationAppService));
 }
Esempio n. 4
0
        public WorkController(
            AppSettings appSettings,
            IMapper mapper,
            IWorkApiService workApi,
            WorkIterationAppService workIterationAppService,
            WorkActivityAppService workActivityAppService,
            WorkLeaderboardAppService workLeaderboardAppService)
            : base(appSettings, workApi)
        {
            if (appSettings == null)
            {
                throw new ArgumentNullException(nameof(appSettings));
            }

            _mapper  = mapper ?? throw new ArgumentNullException(nameof(mapper));
            _workApi = workApi ?? throw new ArgumentNullException(nameof(workApi));
            _workActivityAppService = workActivityAppService ??
                                      throw new ArgumentNullException(nameof(workActivityAppService));
            _workIterationAppService = workIterationAppService ??
                                       throw new ArgumentNullException(nameof(workIterationAppService));
            _workLeaderboardAppService = workLeaderboardAppService ??
                                         throw new ArgumentNullException(nameof(workLeaderboardAppService));
        }
        //public double TotalEffort => this.Result.Items.Sum(x => x.TotalEffort);

        //public double TotalRemainingWork => this.Result.Items.Sum(x => x.TotalRemainingWork);

        public async Task Update(WorkIterationAppService workIterationAppService)
        {
            Result = await workIterationAppService.GetWorkIteration(ProjectId, TeamId, IterationId);

            AreaPaths = Result.Items.Select(x => x.AreaPath).Distinct().OrderBy(x => x).ToList();
        }