public async Task <IActionResult> Create([Bind("Id,Name,BornDate,RegistryDate")] Person person) { if (ModelState.IsValid) { _context.Add(person); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(person)); }
public async Task <IActionResult> Create([Bind("Id,DocumentType,Name,Number,Validity,DocumentLocale")] Document document) { if (ModelState.IsValid) { _context.Add(document); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(document)); }
public async Task InsertAsync(City obj) { _context.Add(obj); await _context.SaveChangesAsync(); }