public async Task <IActionResult> Create([Bind("EmailAddress,PhoneNumber,Address")] UserAccount userAccount) { if (ModelState.IsValid) { _context.Add(userAccount); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(userAccount)); }
public async Task <IActionResult> Create([Bind("GraphicDesignId,DesignType,Color,Size,PaperQuality,ShippingType,UnitPrice,EmailAddress")] GraphicDesign graphicDesign) { if (ModelState.IsValid) { _context.Add(graphicDesign); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["EmailAddress"] = new SelectList(_context.UserAccounts, "EmailAddress", "EmailAddress", graphicDesign.EmailAddress); return(View(graphicDesign)); }