public IActionResult Create([Bind("Id,BuyerName,BuyerPhoneNumber")] Buyer buyer) { if (ModelState.IsValid) { _context.Add(buyer); _context.SaveChanges(); return(RedirectToAction(nameof(Index))); } return(View(buyer)); }
public IActionResult Create([Bind("Id,HouseAddress,HousePrice")] House house) { if (ModelState.IsValid) { _context.Add(house); _context.SaveChanges(); return(RedirectToAction(nameof(Index))); } return(View(house)); }
public IActionResult Create([Bind("Id,HouseId,SellerName,SellerPhoneNumber")] Seller seller) { if (ModelState.IsValid) { _context.Add(seller); _context.SaveChanges(); return(RedirectToAction(nameof(Index))); } ViewData["HouseId"] = new SelectList(_context.House, "Id", "Id", seller.HouseId); return(View(seller)); }
public IActionResult Create([Bind("TransactionId,BuyerId,HouseId")] Transaction transaction) { if (ModelState.IsValid) { _context.Add(transaction); _context.SaveChanges(); return(RedirectToAction(nameof(Index))); } ViewData["BuyerId"] = new SelectList(_context.Buyer, "Id", "Id", transaction.BuyerId); ViewData["HouseId"] = new SelectList(_context.House, "Id", "Id", transaction.HouseId); return(View(transaction)); }