Beispiel #1
0
        /// <summary>
        /// определяет сущности для замены
        /// меняет ссылку у их детей
        /// добавляет scopes детей в scopesToDeprovision
        /// </summary>
        /// <param name="newEntities">Новые сущности типа T</param>
        private EntitiesTuple Do <T>(List <Scope> scopesToDeprovision, List <object> newEntities)
            where T : IEntity
        {
            var rh = RHFactory.Create <T>();

            IEntity[] toSave = new IEntity[0];

            var replacing = GetReplaceEntities(rh, newEntities.Cast <T>());

            if (replacing.Count > 0)
            {
                toSave = rh.UpdateInChilds(session, replacing).ToArray();
                rh.Childs.ForAll(x =>
                                 scopesToDeprovision.AddRange(x.GetScopes()));
            }
            return(new EntitiesTuple(replacing.Keys.Cast <IEntity>().ToArray(), toSave));
        }
Beispiel #2
0
        public int Compare(Type x, Type y)
        {
            var rh = RHFactory.Create(x);

            return(rh.CompareTo(y));
        }