コード例 #1
0
        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));
        }
コード例 #2
0
        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));
        }
コード例 #3
0
        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));
            }
        }
コード例 #4
0
 private bool IsEmpty(GetTags request)
 {
     return(string.IsNullOrEmpty(request.ApiName));
 }
コード例 #5
0
 public MetatagsController()
 // The controller function which calls the service
 {
     //Calling service to get tags after analysing the video
     this.metadataContainer = new GetTags();
 }
コード例 #6
0
 public async Task <ICollection <TagDto> > Handle(GetTags request, CancellationToken cancellationToken)
 {
     return((await _repository.GetList(request.ProfileName)).Select(t => new TagDto {
         Name = t.Name
     }).ToList());
 }