public async Task <IActionResult> Edit(int id, [Bind("ID,Name,LastUpdate")] FundPort fundPort) { if (id != fundPort.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(fundPort); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!FundPortExists(fundPort.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(fundPort)); }
public async Task <IActionResult> Create([Bind("ID,Name,LastUpdate")] FundPort fundPort) { if (ModelState.IsValid) { var user = await _userManager.GetUserAsync(User); fundPort.User = user; _context.Add(fundPort); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(fundPort)); }
// GET: FundPorts/Create public IActionResult Create() { var fundport = new FundPort(); return(View(fundport)); }