Esempio n. 1
0
        public async Task AddRootTag_Test()
        {
            // Root
            CreateTagDto createRootTagDto = new CreateTagDto {
                Name = "Root"
            };
            var rootTagDto = await tagAppService.Create(createRootTagDto);

            var outputDto = await tagAppService.Get(new EntityDto <long> {
                Id = rootTagDto.Id
            });

            outputDto.Name.ShouldBe("Root");
            outputDto.FullName.ShouldBe("Root");
            outputDto.Parent.ShouldBe(null);
            outputDto.Children.Count.ShouldBe(0);
        }
Esempio n. 2
0
        public async Task <JsonResult> Get(string id)
        {
            var result = await _tagAppService.Get(id);

            OutputModel outputModel = new OutputModel();

            outputModel.Data = result;
            return(new JsonResult(outputModel));
        }
Esempio n. 3
0
 public TagDto Get(int id)
 {
     return(_tagAppService.Get(id));
 }
Esempio n. 4
0
        public async Task <IActionResult> GetAll(CancellationToken token = default)
        {
            var tags = await _service.Get(token);

            return(ApiResponse(tags));
        }