コード例 #1
0
        // GET: Products/Create
        public async Task <IActionResult> Create()
        {
            var categories = await _categoriesService.GetAllAsync();

            var supplierses = await _suppliersService.GetAllAsync();

            ViewData["CategoryId"] = new SelectList(categories, "CategoryId", "CategoryName");
            ViewData["SupplierId"] = new SelectList(supplierses, "SupplierId", "CompanyName");
            return(View());
        }
コード例 #2
0
        public async Task <IHttpActionResult> GetAllAsync()
        {
            IEnumerable <SuppliersDTM> suppliers = await service.GetAllAsync();

            if (suppliers == null)
            {
                return(NotFound());
            }
            return(Ok(suppliers));
        }
コード例 #3
0
 public async Task <IActionResult> Get()
 {
     return(Ok(await _suppliersService.GetAllAsync()));
 }