Please i need help, i have two tables User and ExistingUser
i have a foreign key UserId in the ExistingUser table,
And on the user interface i can search for the names from the User Table,
how can i post the name into the UserId(FK)column in the ExistingUser table.
i'm using asp.net core 2.0 mvc
- [HttpPost]
- public async Task<IActionResult> Existing(BigView big)
- {
- if (!ModelState.IsValid)
- {
- return View();
- }
- var student = (from p in _context.Users where p.UserId== p.UserId select p).First();
- _context.ExistingUser.Add(big.ExistingUser);
- await _context.SaveChangesAsync();
- return RedirectToAction("Existing");
- }