public void Add(Car car) { if (list.Exists(item => item == car)) return; list.Add(car); }
public ActionResult AddNewCar_Post() { Car carOne = new Car(); TryUpdateModel(carOne); if (ModelState.IsValid) { UpdateModel(carOne); _carsdata.StoreCartoDb(carOne); return RedirectToAction("Cars","Cars"); } return View(); }
public Policy(Car car) { Car = car; ID = 0; }
protected override void loadFromSql() { DataTable dt = _provider.Select("Car"); foreach (DataRow row in dt.Rows) { Car car = new Car(row); Add(car); } }
public void StoreCartoDb(Car newCarDetails) { ConnectedRepository ctx = new ConnectedRepository(DbName); ctx.Cars.Save(newCarDetails); }