public async Task <IActionResult> Create([Bind("Id,Name")] Categories categories)
        {
            if (ModelState.IsValid)
            {
                _context.Add(categories);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(categories));
        }
Beispiel #2
0
        public async Task <IActionResult> Create([Bind("Id,Name,Date,Cpf_Cnpj,Rg,Address,AddressNumber,Neighborhood,City,TelePhone,CellPhone,Email,Comments")] Client client)
        {
            if (ModelState.IsValid)
            {
                _context.Add(client);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(client));
        }
Beispiel #3
0
        public async Task <IActionResult> Create([Bind("Id,User,Password")] Adm adm)
        {
            if (ModelState.IsValid)
            {
                _context.Add(adm);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(adm));
        }
 public async Task InsertAsync(Product obj)
 {
     _context.Add(obj);
     await _context.SaveChangesAsync();
 }
 public void Insert(Product obj)
 {
     _context.Add(obj);
     _context.SaveChanges();
 }