Esempio n. 1
0
        public static void Seed(ArchitectDbContext dbContext)
        {
            dbContext.Add(new User()
            {
                FirstName = "Name", LastName = "Surname", Username = "******", Password = "******"
            });
            dbContext.Add(new Record()
            {
                Description = "Record 1"
            });

            dbContext.SaveChanges();
        }
Esempio n. 2
0
        public async Task <IActionResult> Create([Bind("ID,FirstName,LastName")] Customer customer)
        {
            if (ModelState.IsValid)
            {
                _context.Add(customer);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(customer));
        }