/// <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); } } }
private bool ByOperationWithResult(IOperationWithResult operation) { return operation != null && operation.ResultIsIsolated.HasValue && operation.ResultIsIsolated.Value; }
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); }