コード例 #1
0
        public void ExecuteInMemory(Core.EntityCollectionBase target)
        {
            if (!target.IsLoaded)
            {
                return;
            }

            //if (IsExecutedInMemory)
            //    return;

            if (Relationship is not null && Relationship.Name != target.Relationship.Name)
            {
                return;
            }

            OGM?parent = target.ParentItem(this);

            if (parent is not null && target.Parent != parent)
            {
                return;
            }

            InMemoryLogic(target);

            IsExecutedInMemory = true;
        }
コード例 #2
0
        public void ExecuteInMemory(Core.EntityCollectionBase target)
        {
            if (!target.IsLoaded)
            {
                return;
            }

            if (Relationship != null)
            {
                if (Relationship.Name != target.Relationship.Name)
                {
                    return;
                }

                if (ActsOnSpecificParent())
                {
                    if (target.Parent != target.ParentItem(this))
                    {
                        return;
                    }
                }
            }
            else
            {
                Entity entity    = InItem.GetEntity();
                bool   shouldRun = false;
                if (target.ParentEntity == entity)
                {
                    shouldRun = true;
                    if (target.ForeignProperty != null && !target.ForeignProperty.Nullable)
                    {
                        return;
                    }
                }
                if (target.ForeignEntity == entity)
                {
                    shouldRun = true;
                    if (target.ParentProperty != null && !target.ParentProperty.Nullable)
                    {
                        return;
                    }
                }
                if (!shouldRun)
                {
                    return;
                }
            }
            InMemoryLogic(target);
        }