Esempio n. 1
0
        /// <summary>
        /// Delete Vehicle Make
        /// </summary>
        public void DeleteVehicleMake(long vehicleMakeId)
        {
            VehicleMake dbversion = vehicleMakeRepository.Find(vehicleMakeId);

            CheckVehicleMakeAssociations(vehicleMakeId);
            if (dbversion == null)
            {
                throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture,
                                                                  "Vehicle Make with Id {0} not found!", vehicleMakeId));
            }
            vehicleMakeRepository.Delete(dbversion);
            vehicleMakeRepository.SaveChanges();
        }