Exemplo n.º 1
0
        public async Task <IActionResult> LoadAllFunction(TRequest <RequesId> request)
        {
            var response = new Response <object>();

            try
            {
                var ListFunctionShowMenu = await _functionService.ListFunctionIsShowMenu();

                var ListAllFunction = await _functionService.ListAllFunction();

                var ObjectData = _functionService.BuildFancyTree(ListFunctionShowMenu, ListAllFunction);

                response.Success = true;
                response.Data    = ObjectData;

                return(Ok(new
                {
                    Success = response.Success,
                    Message = response.Message,
                    Data = ObjectData,
                    //DropDownList = districts.Select(c => new { Id = c.Id, Name = c.Name }).ToList()
                }));
            }
            catch (Exception ex)
            {
                response.Success = false;
                response.Message = ex.Message + "," + ex.InnerException;
            }
            return(Ok(response));
        }