Пример #1
0
        protected virtual void NullifyUniReferences(object obj, IClassMap classMap, IList classMapsWithUniRefs)
        {
            if (classMapsWithUniRefs.Count < 1)
            {
                return;
            }

            IDomainMap         domainMap = this.Context.DomainMap;
            IPersistenceEngine pe        = this.Context.PersistenceEngine;
            IAssemblyManager   am        = this.Context.AssemblyManager;

            foreach (IClassMap classMapWithUniRef in classMapsWithUniRefs)
            {
                Type  classWithUniRef    = am.GetTypeFromClassMap(classMapWithUniRef);
                IList objectsWithUniRefs = pe.GetObjectsOfClassWithUniReferencesToObject(classWithUniRef, obj);
                IList uniRefPropertyMaps = classMapWithUniRef.GetUniDirectionalReferencesTo(classMap, true);
                foreach (object test in objectsWithUniRefs)
                {
                    IClassMap testClassMap = domainMap.MustGetClassMap(test.GetType());
                    NullifyUniReferencesInObject(obj, classMap, test, testClassMap, uniRefPropertyMaps);
                }
            }
        }