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)); }
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()); }