public async Task <IActionResult> CreateTag(string name, string description, List <IFormFile> images)
        {
            // If the user sends `images` POST param then the list<IFormFile> will be populated, if the user sends `images[]` instead, then it will be empty
            // this is why I populate that list with this little trick
            if (images?.Count == 0)
            {
                images = Request.Form.Files.GetFiles("images[]").ToList();
            }
            Tag tag = await _tagsService.Create(name, description, images);

            return(StatusCodeAndDtoWrapper.BuildSuccess(TagDto.Build(tag), "Tag created successfully"));
        }
        public static HomeResponse Build(List <Entities.Tag> tags, List <Entities.Category> categories)
        {
            List <TagDto>      tagDtos      = new List <TagDto>(tags.Count);
            List <CategoryDto> categoryDtos = new List <CategoryDto>(tags.Count);

            foreach (var tag in tags)
            {
                tagDtos.Add(TagDto.Build(tag));
            }

            foreach (var category in categories)
            {
                categoryDtos.Add(CategoryDto.Build(category));
            }

            return(new HomeResponse
            {
                Tags = tagDtos,
                Categories = categoryDtos
            });
        }