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))); } }
public async Task <ActionResult <Tree> > GetTreeView() { return(await Task.Run(() => { var treeView = _treeViewService.GetTreeView(); if (treeView == null) { return NotFound(); } return new ActionResult <Tree>(treeView); })); }