示例#1
0
        public async Task <TaskProvider> GetTaskProviderById(int id, CancellationToken cancellationToken = default(CancellationToken))
        {
            cancellationToken.ThrowIfCancellationRequested();

            var spec = new TaskProviderFilterSpecification(id);

            spec.IncludeStrings.Add("Tags.Tag");
            return(await _taskProviderRepository.GetSingleBySpec(spec, cancellationToken));
        }
示例#2
0
        public async Task <List <TaskProvider> > GetTaskProviders(string type = "all", CancellationToken cancellationToken = default(CancellationToken))
        {
            cancellationToken.ThrowIfCancellationRequested();

            var spec = new TaskProviderFilterSpecification(null, type != "all" ? type : null);

            spec.IncludeStrings.Add("Tags.Tag");
            var taskProviders = await _taskProviderRepository.GetBySpec(spec, cancellationToken);

            return(taskProviders.ToList());
        }