public Users create(Users newUser) { var usr = _context.Add(newUser).Entity; _context.SaveChanges(); return(usr); }
public async Task <IActionResult> Create([Bind("Id,Name")] Value value) { if (ModelState.IsValid) { _context.Add(value); await _context.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(value)); }
private static void Add(SQLiteDbContext db) { var user = new User { Age = 1, Gender = 1, Name = "dfaf", OpTime = DateTime.Now }; db.Add <User>(user); }