Esempio n. 1
0
        public async Task <IActionResult> Create([Bind("Id,Name")] Models.Department departments)
        {
            if (ModelState.IsValid)
            {
                _context.Add(departments);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(departments));
        }
Esempio n. 2
0
 public async Task InsertAsinc(Seller obj)
 {
     // obj.Department = _context.Department.First();
     _context.Add(obj);
     await _context.SaveChangesAsync();
 }