Ejemplo n.º 1
0
        public async Task <IActionResult> Create([Bind("ID,Name,Value")] Bandwidth bandwidth)
        {
            if (ModelState.IsValid)
            {
                _context.Add(bandwidth);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(bandwidth));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("ID,Name,Occupation,TotalSale,IsTotalSalePositiv,Image")] User user)
        {
            if (ModelState.IsValid)
            {
                _context.Add(user);
                await _context.SaveChangesAsync();

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