Example #1
0
        public Users create(Users newUser)
        {
            var usr = _context.Add(newUser).Entity;

            _context.SaveChanges();
            return(usr);
        }
Example #2
0
        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));
        }
Example #3
0
        private static void Add(SQLiteDbContext db)
        {
            var user = new User
            {
                Age    = 1,
                Gender = 1,
                Name   = "dfaf",
                OpTime = DateTime.Now
            };

            db.Add <User>(user);
        }