コード例 #1
0
        public IActionResult Create()
        {
            var departaments = _departamentService.FindAll();
            var viewModel    = new SellerFormViewModel {
                Departaments = departaments
            };

            return(View(viewModel)); //pegar os departamentos na hora da criaçao
        }
コード例 #2
0
        public IActionResult Create()
        {
            var departaments = _DepartamentService.FindAll();
            var viewModel    = new SellerFormViewModel {
                Departaments = departaments
            };

            return(View(viewModel));
        }
コード例 #3
0
        public IActionResult Create()
        {
            var departaments = _departamentService.FindAll(); //retorna todos os departamentos do banco
            var viewModel    = new SellerFormViewModel {
                Departaments = departaments
            };                       /// colecao la do modelview

            return(View(viewModel)); // retorna a view com os departamentos populados
        }