示例#1
0
        public IActionResult List_Unit() // done
        {
            UnitIndexViewModel model = new UnitIndexViewModel();

            model.getUnit = repository_unit.Get_Unit();
            return(Json(model));
        }
        public async Task <IActionResult> Index()
        {
            var Unit = await _unitRepo.GetAllAsync().ConfigureAwait(true);

            var indexViewModel = new List <UnitIndexViewModel>();

            foreach (var data in Unit)
            {
                var model = new UnitIndexViewModel();
                model.UnitId = data.Id;
                model.Status = data.Status;
                model.Name   = data.Name;
                indexViewModel.Add(model);
            }

            return(View(indexViewModel));
        }