Beispiel #1
0
        /// <summary>
        /// Adding a Reference to the event promise info. If we don't add the reference, the surrogate will no be persisted
        /// </summary>
        /// <param name="val"></param>
        private void AddReferenceIntoStateObjectSurrogate(IPromise val)
        {
            var stateObjectSurrogate = DictionaryUtils.GetObjectContainingMethod(val) as IStateObjectSurrogate;

            if (stateObjectSurrogate != null)
            {
                surrogateManager.AddSurrogateReference(stateObjectSurrogate, (IStateObject)val);
            }
        }
Beispiel #2
0
        /// <summary>
        /// Removing the reference from the surrogate.
        /// </summary>
        /// <param name="internalValue"></param>
        private void RemoveReferenceFromStateObjectSurrogate(CollectionStateObjectReference internalValue)
        {
            var obj = internalValue.Target as IPromise;

            if (obj != null)
            {
                var surrogate = DictionaryUtils.GetObjectContainingMethod(obj) as IStateObjectSurrogate;
                if (surrogate != null)
                {
                    surrogateManager.RemoveSurrogateReference(surrogate, (IStateObject)obj);
                }
            }
        }