Ejemplo n.º 1
0
        // [ValidateAntiForgeryToken]
        public async Task <IActionResult> Create([Bind("ShopId,ShopName,PhoneNumber,WebsiteUrl,City")] Shops shops)
        {
            if (ModelState.IsValid)
            {
                _context.Add(shops);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(shops));
        }
Ejemplo n.º 2
0
        // [ValidateAntiForgeryToken]
        public async Task <IActionResult> Create([Bind("CustomerId,FullName,UserName,PhoneNumber,EmailAddress")] Customers customers)
        {
            if (ModelState.IsValid)
            {
                _context.Add(customers);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(customers));
        }