public async Task <IActionResult> Create([Bind("BLId,Number,Consignee,Ship")] BL bL) { if (ModelState.IsValid) { _context.Add(bL); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(bL)); }
public async Task <IActionResult> Create([Bind("IdBl,Num,Consignee,Navio")] BL bl) { if (ModelState.IsValid) { portoContext.Add(bl); await portoContext.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(bl)); }
public async Task <IActionResult> Create(int id, [Bind("IdContainer,numContainer,tipo,tamanho,IdBl")] Models.Container container) { if (ModelState.IsValid) { portoContext.Add(container); await portoContext.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["IdBl"] = new SelectList(portoContext.BLs, "IdBl", "IdBl"); return(View(container)); }
public async Task <IActionResult> Create([Bind("ContainerId,Number,Type,Size,BLId")] Container container) { if (ModelState.IsValid) { _context.Add(container); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["BLId"] = new SelectList(_context.BLs, "BLId", "BLId", container.BLId); return(View(container)); }
public void Add <T>(T entity) where T : class { _context.Add(entity); }