public async Task <IActionResult> Edit(int id, [Bind("ProductPresentationId,Name,Description,ImagePath,IsActive,CreatedAt,CreatedBy,UpdatedAt,UpdatedBy")] Productpresentation productpresentation) { if (id != productpresentation.ProductPresentationId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(productpresentation); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProductpresentationExists(productpresentation.ProductPresentationId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(productpresentation)); }
public async Task <IActionResult> Create([Bind("ProductPresentationId,Name,Description,ImagePath,IsActive,CreatedAt,CreatedBy,UpdatedAt,UpdatedBy")] Productpresentation productpresentation) { if (ModelState.IsValid) { _context.Add(productpresentation); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(productpresentation)); }