Example #1
0
 public int AddCarModel(int carBrandId, string name)
 {
     CarModel newCarModel = new CarModel
     {
         CarBrandId = carBrandId,
         Name = name
     };
     db.CarModels.InsertOnSubmit(newCarModel);
     Save();
     return newCarModel.Id;
 }
 partial void DeleteCarModel(CarModel instance);
 partial void UpdateCarModel(CarModel instance);
 partial void InsertCarModel(CarModel instance);
		private void detach_CarModels(CarModel entity)
		{
			this.SendPropertyChanging();
			entity.CarBrand = null;
		}
		private void attach_CarModels(CarModel entity)
		{
			this.SendPropertyChanging();
			entity.CarBrand = this;
		}