BExIS.Dlm.Services.DataStructure.DataTypeManager.Delete C# (CSharp) Метод

Delete() публичный Метод

public Delete ( DataType entity ) : bool
entity BExIS.Dlm.Entities.DataStructure.DataType
Результат bool
        public bool Delete(DataType entity)
        {
            Contract.Requires(entity != null);
            Contract.Requires(entity.Id >= 0);

            using (IUnitOfWork uow = this.GetUnitOfWork())
            {
                IRepository<DataType> repo = uow.GetRepository<DataType>();

                entity = repo.Reload(entity);

                // remove all associations
                entity.ApplicableUnits.ToList().ForEach(u => u.AssociatedDataTypes.Remove(entity));
                entity.ApplicableUnits.Clear();
                entity.DataContainers.Clear();

                repo.Delete(entity);
                uow.Commit();
            }
            // if any problem was detected during the commit, an exception will be thrown!
            return (true);
        }

Same methods

DataTypeManager::Delete ( IEnumerable entities ) : bool