public Rental(PostRental postRental) { Description = postRental.Description; NumberOfRooms = postRental.NumberOfRooms; Price = postRental.Price; Address = (postRental.Address ?? string.Empty).Split('\n').ToList(); }
public Rental(PostRental postRental) { NumberOfRooms = postRental.NumberOfRooms; Description = postRental.Description; Price = postRental.Price; Address = (postRental.Address ?? string.Empty).Split('\n').ToList(); }
public ActionResult Post(PostRental postRental) { var rental = new Rental(postRental); _rentalRepository.Insert(rental); return(RedirectToAction("Index")); }
public ActionResult Post(PostRental postRental) { var rental = new Rental(postRental); Context.Rentals.InsertOne(rental); return(RedirectToAction("Index")); }
public async Task <ActionResult> Post(PostRental postRental) { var rental = new Rental(postRental); //Context.Rentals.Insert(rental); //ContextNew.Rentals.InsertOne(rental); await ContextNew.Rentals.InsertOneAsync(rental); return(RedirectToAction("Index")); }
public async Task<ActionResult> Post(PostRental postRental) { var rental = new Rental(postRental); await Context.Rentals.InsertOneAsync(rental); return RedirectToAction("Index"); }
public ActionResult Edit(string id, PostRental postRental) { try { return RedirectToAction("Index"); } catch { return View(); } }
// GET: Rentals/Edit/5 public async Task<ActionResult> Edit(string id) { var filter = new BsonDocument("_id", new ObjectId(id)); var rental = await Context.Rentals.Find(filter).FirstOrDefaultAsync(); var postRental = new PostRental { //TODO: Edit is not ready yet }; return View(rental); }
public ActionResult Post(PostRental postRental) { var rental = new Rental(postRental); Context.Rentals.Insert(rental); return RedirectToAction("Index"); }