コード例 #1
0
ファイル: SupplierService.cs プロジェクト: nayots/SoftUni
        public AllSuppliersModel All()
        {
            var model = new AllSuppliersModel()
            {
                Suppliers = this.db.Suppliers.Select(s => new SupplierListModel()
                {
                    Id       = s.Id,
                    Name     = s.Name,
                    Importer = s.IsImporter
                }).ToList()
            };

            return(model);
        }
コード例 #2
0
ファイル: SuppliersController.cs プロジェクト: nayots/SoftUni
        public IActionResult List()
        {
            AllSuppliersModel suppliersModel = this.supplierService.All();

            return(View(suppliersModel));
        }