From 4265855652a365f6e350f080a985cf3544441a55 Mon Sep 17 00:00:00 2001 From: Louis DeJardin Date: Wed, 16 Dec 2015 22:35:41 -0800 Subject: [PATCH] PR feedback Adding comment about reason for public field --- .../FeatureReferences.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Microsoft.AspNet.Http.Features/FeatureReferences.cs b/src/Microsoft.AspNet.Http.Features/FeatureReferences.cs index 75fcacc0db..30d7c3638f 100644 --- a/src/Microsoft.AspNet.Http.Features/FeatureReferences.cs +++ b/src/Microsoft.AspNet.Http.Features/FeatureReferences.cs @@ -14,9 +14,14 @@ namespace Microsoft.AspNet.Http.Features Revision = collection.Revision; } - public readonly IFeatureCollection Collection; - public int Revision; - public TCache Cache; + public IFeatureCollection Collection { get; private set; } + public int Revision { get; private set; } + + // cache is a public field because the code calling Fetch must + // be able to pass ref values that "dot through" the TCache struct memory, + // if it was a Property then that getter would return a copy of the memory + // preventing the use of "ref" + public TCache Cache; public TFeature Fetch( ref TFeature cached,