BExIS.Dlm.Services.DataStructure.ClassifierManager.RemoveChild C# (CSharp) Метод

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

public RemoveChild ( Classifier end1, Classifier end2 ) : bool
end1 BExIS.Dlm.Entities.DataStructure.Classifier
end2 BExIS.Dlm.Entities.DataStructure.Classifier
Результат bool
        public bool RemoveChild(Classifier end1, Classifier end2)
        {
            Contract.Requires(end1 != null && end1.Id >= 0);
            Contract.Requires(end2 != null && end2.Id >= 0);

            bool result = false;
            using (IUnitOfWork uow = this.GetUnitOfWork())
            {
                IRepository<Classifier> repo = uow.GetRepository<Classifier>();

                end1 = repo.Reload(end1);
                repo.LoadIfNot(end1.Children);

                end2 = repo.Reload(end2);
                repo.LoadIfNot(end2.Parent);

                if (end1.Children.Contains(end2) || end2.Parent.Equals(end1))
                {
                    end1.Children.Remove(end2);
                    end2.Parent = null;
                    uow.Commit();
                    result = true;
                }
            }
            return (result);
        }