예제 #1
0
 public async Task <ActionResult <List <GetTreeViewDTO> > > Get([FromQuery] Guid?rootId)
 {
     try
     {
         return(Ok(await _treeViewService.GetTreeView(rootId)));
     }
     catch (System.Exception ex)
     {
         return(BadRequest(ErrorDTO.Create(ex.Message)));
     }
 }
예제 #2
0
        public async Task <ActionResult <Tree> > GetTreeView()
        {
            return(await Task.Run(() =>
            {
                var treeView = _treeViewService.GetTreeView();

                if (treeView == null)
                {
                    return NotFound();
                }

                return new ActionResult <Tree>(treeView);
            }));
        }