예제 #1
0
        /// <summary>
        /// Delete Service Type by id
        /// </summary>
        public void DeleteServiceType(long serviceTypeId)
        {
            ServiceType dbversion = serviceTypeRepository.Find((int)serviceTypeId);

            ValidateBeforeDeletion(serviceTypeId);
            if (dbversion == null)
            {
                throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture,
                                                                  "Service Type with Id {0} not found!", serviceTypeId));
            }
            serviceTypeRepository.Delete(dbversion);
            serviceTypeRepository.SaveChanges();
        }