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); }
public async Task <JsonResult> Get(string id) { var result = await _tagAppService.Get(id); OutputModel outputModel = new OutputModel(); outputModel.Data = result; return(new JsonResult(outputModel)); }
public TagDto Get(int id) { return(_tagAppService.Get(id)); }
public async Task <IActionResult> GetAll(CancellationToken token = default) { var tags = await _service.Get(token); return(ApiResponse(tags)); }