コード例 #1
0
ファイル: GetChartQuery.cs プロジェクト: ThanhCuD/WebApi
        public async Task <Response <GetChartViewModel> > Handle(GetChartQuery request, CancellationToken cancellationToken)
        {
            GetChartViewModel result = new GetChartViewModel();
            var allPerson            = await _repository.GetAllAsync();

            var root = allPerson.FirstOrDefault(_ => _.IdParent == 0);

            if (root != null)
            {
                result.Id          = root.Id;
                result.Name        = root.Name;
                result.Description = "";
                result.Children    = findChild(root);
            }
            return(new Response <GetChartViewModel>(result));
        }
コード例 #2
0
 public Task <List <Person> > GetAllAsync()
 {
     return(personRepository.GetAllAsync());
 }