// 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()); }
public async Task <IHttpActionResult> GetAllAsync() { IEnumerable <SuppliersDTM> suppliers = await service.GetAllAsync(); if (suppliers == null) { return(NotFound()); } return(Ok(suppliers)); }
public async Task <IActionResult> Get() { return(Ok(await _suppliersService.GetAllAsync())); }