public IHttpActionResult CreateDoor([FromBody] string name) { FakeDatabase fakeDatabase = new FakeDatabase(); fakeDatabase.Add(name); return(Ok()); }
public ActionResult AddContact(Contact c) { var database = new FakeDatabase(); database.Add(c); return(RedirectToAction("Index")); }
public ActionResult AddMovie(MovieProperties newMovie) { if (ModelState.IsValid) { var database = new FakeDatabase(); database.Add(newMovie); return(RedirectToAction("Index")); } return(View("Add", newMovie)); }
public ActionResult Create(DealerViewModel dealer) { if (!ModelState.IsValid) { return(View(dealer)); } try { FakeDatabase.Add(dealer); return(RedirectToAction(nameof(Index))); } catch { return(View("Edit", dealer)); } }