public async Task <IEnumerable <string> > Handle(GetTags request, CancellationToken cancellationToken) { var tags = from attr in _dataStore.Tags orderby attr.Value select attr.Value; return(await Task.FromResult(tags)); }
public async Task <IActionResult> GetPopularTags([FromBody] GetTags getTag) { Logger.LogInformation($"{nameof(TagsController)}.{nameof(GetPopularTags)}.Start"); var result = await MainDb.Tags.GetPopularTags(getTag.PageParams.Offset, getTag.PageParams.Count); Logger.LogInformation($"{nameof(TagsController)}.{nameof(GetPopularTags)}.End"); return(new OkResponseResult("Popular Tags", result)); }
public async Task <Response <IEnumerable <string> > > Handle(GetTags request) { if (IsEmpty(request)) { var tags = await _context.Tags.Select(x => x.Name).ToListAsync(); return(new Response <IEnumerable <string> >(tags)); } else { var tags = await _context.ApiTags .Include(x => x.Api) .Include(x => x.Tag) .Where(x => x.Api.Name.Equals(request.ApiName)) .Select(x => x.Tag.Name) .ToListAsync(); return(new Response <IEnumerable <string> >(tags)); } }
private bool IsEmpty(GetTags request) { return(string.IsNullOrEmpty(request.ApiName)); }
public MetatagsController() // The controller function which calls the service { //Calling service to get tags after analysing the video this.metadataContainer = new GetTags(); }
public async Task <ICollection <TagDto> > Handle(GetTags request, CancellationToken cancellationToken) { return((await _repository.GetList(request.ProfileName)).Select(t => new TagDto { Name = t.Name }).ToList()); }