public async Task <IActionResult> Create([Bind("Id,Nome")] Department department)
        {
            if (ModelState.IsValid)
            {
                _context.Add(department);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(department));
        }
Ejemplo n.º 2
0
 public void Insert(Seller obj)
 {
     obj.Department = _context.Department.First();
     _context.Add(obj);
     _context.SaveChanges();
 }