public async Task <ActionResult <SupplierDto> > GetSupplier(int id) { Product product = await _context.Products.FindAsync(id); if (product == null) { return(NotFound()); } return(DtoConverter.ConvertToSupplierDto(product.Supplier)); }
public async Task <ActionResult <SupplierDto> > GetSupplier(int id) { var supplier = await _context.Suppliers.FindAsync(id); if (supplier == null) { return(NotFound()); } return(DtoConverter.ConvertToSupplierDto(supplier)); }