Example #1
0
        /// <summary>
        /// Make sure we don't return direct references to mutable objects within the model
        /// </summary>
        protected virtual void EnsureNoMutableReferences(ref object result, IOperationWithResult operation)
        {
            if (result != null)
            {
                bool operationIsResponsible = operation != null && operation.ResultIsSafe;

                if (!operationIsResponsible && !result.IsImmutable())
                {
                    result = _resultFormatter.Clone(result);
                }
            }
        }
Example #2
0
 private bool ByOperationWithResult(IOperationWithResult operation)
 {
     return operation != null &&
            operation.ResultIsIsolated.HasValue &&
            operation.ResultIsIsolated.Value;
 }
Example #3
0
 protected override void EnsureNoMutableReferences(ref object result, IOperationWithResult operation)
 {
     //noop, result is immutable and so is model, no cloning necessary
 }
Example #4
0
 protected override void EnsureNoMutableReferences(ref object result, IOperationWithResult operation)
 {
     //noop, result is immutable and so is model, no cloning necessary
 }
 private bool ByOperationWithResult(IOperationWithResult operation)
 {
     return(operation != null &&
            operation.ResultIsIsolated.HasValue &&
            operation.ResultIsIsolated.Value);
 }