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)); }
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)); }
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(); }