public async Task DodajDokoszykaPojedynczo(int id) { KoszykBusinessLogic koszyk = new KoszykBusinessLogic(this._context, this.HttpContext); Produkt produkt = await _context.Produkt.FindAsync(id); koszyk.DodajDoKoszyka(produkt); }
public async Task <ActionResult> DodajDoKoszyka(int id) { // Add it to the shopping cart KoszykBusinessLogic koszyk = new KoszykBusinessLogic(this._context, this.HttpContext); Produkt produkt = await _context.Produkt.FindAsync(id); koszyk.DodajDoKoszyka(produkt); return(RedirectToAction(nameof(Index))); // Go back to the main store page for more shopping }