예제 #1
0
        /// <summary>
        /// Delete Vehicle Model
        /// </summary>
        public void DeleteVehicleModel(long vehicleModelId)
        {
            VehicleModel dbversion = vehicleModelRepository.Find(vehicleModelId);

            CheckVehicleModelAssociations(vehicleModelId);
            if (dbversion == null)
            {
                throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture,
                                                                  "Vehicle Model with Id {0} not found!", vehicleModelId));
            }
            vehicleModelRepository.Delete(dbversion);
            vehicleModelRepository.SaveChanges();
        }