259 instantiations of EntityTagHeaderValue
FilesWebSite (5)
Controllers\DownloadFilesController.cs (4)
31var entityTag = new EntityTagHeaderValue("\"Etag\""); 45var entityTag = new EntityTagHeaderValue("\"Etag\""); 93var entityTag = new EntityTagHeaderValue("\"Etag\""); 112var entityTag = new EntityTagHeaderValue("\"Etag\"");
Controllers\EmbeddedFilesController.cs (1)
40file.EntityTag = new Microsoft.Net.Http.Headers.EntityTagHeaderValue("\"Etag\"");
Microsoft.AspNetCore.Http.Extensions.Tests (1)
HeaderDictionaryTypeExtensionsTest.cs (1)
99var expected = new EntityTagHeaderValue("\"123\"");
Microsoft.AspNetCore.Http.Results.Tests (47)
HttpFileStreamResultTests.cs (1)
66var entityTag = new EntityTagHeaderValue("\"Etag\"");
PushStreamResultTests.cs (1)
54var entityTag = new EntityTagHeaderValue("\"Etag\"");
src\Shared\ResultsTests\FileContentResultTestBase.cs (16)
58var entityTag = new EntityTagHeaderValue("\"Etag\""); 66new EntityTagHeaderValue("\"Etag\""), 97var entityTag = new EntityTagHeaderValue("\"Etag\""); 104new EntityTagHeaderValue("\"Etag\""), 136var entityTag = new EntityTagHeaderValue("\"Etag\""); 143new EntityTagHeaderValue("\"Etag\""), 146requestHeaders.IfRange = new RangeConditionHeaderValue(new EntityTagHeaderValue("\"Etag\"")); 170var entityTag = new EntityTagHeaderValue("\"Etag\""); 177new EntityTagHeaderValue("\"Etag\""), 180requestHeaders.IfRange = new RangeConditionHeaderValue(new EntityTagHeaderValue("\"NotEtag\"")); 207var entityTag = new EntityTagHeaderValue("\"Etag\""); 238var entityTag = new EntityTagHeaderValue("\"Etag\""); 270var entityTag = new EntityTagHeaderValue("\"Etag\""); 277new EntityTagHeaderValue("\"NotEtag\""), 304var entityTag = new EntityTagHeaderValue("\"Etag\""); 311new EntityTagHeaderValue("\"Etag\""),
src\Shared\ResultsTests\FileStreamResultTestBase.cs (17)
34var entityTag = new EntityTagHeaderValue("\"Etag\""); 44new EntityTagHeaderValue("\"Etag\""), 76var entityTag = new EntityTagHeaderValue("\"Etag\""); 85new EntityTagHeaderValue("\"Etag\""), 88requestHeaders.IfRange = new RangeConditionHeaderValue(new EntityTagHeaderValue("\"Etag\"")); 117var entityTag = new EntityTagHeaderValue("\"Etag\""); 126new EntityTagHeaderValue("\"Etag\""), 154var entityTag = new EntityTagHeaderValue("\"Etag\""); 163new EntityTagHeaderValue("\"Etag\""), 194var entityTag = new EntityTagHeaderValue("\"Etag\""); 227var entityTag = new EntityTagHeaderValue("\"Etag\""); 261var entityTag = new EntityTagHeaderValue("\"Etag\""); 269new EntityTagHeaderValue("\"NotEtag\""), 297var entityTag = new EntityTagHeaderValue("\"Etag\""); 305new EntityTagHeaderValue("\"Etag\""), 336var entityTag = new EntityTagHeaderValue("\"Etag\""); 347new EntityTagHeaderValue("\"Etag\""),
src\Shared\ResultsTests\PhysicalFileResultTestBase.cs (6)
70var entityTag = new EntityTagHeaderValue("\"Etag\""); 77requestHeaders.IfRange = new RangeConditionHeaderValue(new EntityTagHeaderValue("\"Etag\"")); 102var entityTag = new EntityTagHeaderValue("\"Etag\""); 109requestHeaders.IfRange = new RangeConditionHeaderValue(new EntityTagHeaderValue("\"Etag\"")); 129var entityTag = new EntityTagHeaderValue("\"Etag\""); 136requestHeaders.IfRange = new RangeConditionHeaderValue(new EntityTagHeaderValue("\"NotEtag\""));
src\Shared\ResultsTests\VirtualFileResultTestBase.cs (6)
91var entityTag = new EntityTagHeaderValue("\"Etag\""); 95requestHeaders.IfRange = new RangeConditionHeaderValue(new EntityTagHeaderValue("\"Etag\"")); 128var entityTag = new EntityTagHeaderValue("\"Etag\""); 132requestHeaders.IfRange = new RangeConditionHeaderValue(new EntityTagHeaderValue("\"Etag\"")); 161var entityTag = new EntityTagHeaderValue("\"Etag\""); 165requestHeaders.IfRange = new RangeConditionHeaderValue(new EntityTagHeaderValue("\"NotEtag\""));
Microsoft.AspNetCore.Mvc.Core.Test (62)
ControllerBaseTest.cs (6)
1709var entityTag = (entityTagString == null) ? null : new EntityTagHeaderValue(entityTagString); 1753var entityTag = (entityTagString == null) ? null : new EntityTagHeaderValue(entityTagString); 1797var entityTag = (entityTagString == null) ? null : new EntityTagHeaderValue(entityTagString); 1841var entityTag = (entityTagString == null) ? null : new EntityTagHeaderValue(entityTagString); 1895var entityTag = (entityTagString == null) ? null : new EntityTagHeaderValue(entityTagString); 1947var entityTag = (entityTagString == null) ? null : new EntityTagHeaderValue(entityTagString);
FileResultHelperTest.cs (10)
252var etag = new EntityTagHeaderValue("\"Etag\""); 255new EntityTagHeaderValue(ifMatch), 260new EntityTagHeaderValue(ifNoneMatch, isWeak), 292var etag = new EntityTagHeaderValue("\"Etag\""); 295new EntityTagHeaderValue(ifMatch), 300new EntityTagHeaderValue(ifNoneMatch, isWeak), 330var etag = new EntityTagHeaderValue("\"Etag\""); 333new EntityTagHeaderValue(ifMatch), 338new EntityTagHeaderValue(ifNoneMatch, isWeak), 366var etag = new EntityTagHeaderValue("\"Etag\"");
FileStreamResultTest.cs (1)
77var entityTag = new EntityTagHeaderValue("\"Etag\"");
src\Shared\ResultsTests\FileContentResultTestBase.cs (16)
58var entityTag = new EntityTagHeaderValue("\"Etag\""); 66new EntityTagHeaderValue("\"Etag\""), 97var entityTag = new EntityTagHeaderValue("\"Etag\""); 104new EntityTagHeaderValue("\"Etag\""), 136var entityTag = new EntityTagHeaderValue("\"Etag\""); 143new EntityTagHeaderValue("\"Etag\""), 146requestHeaders.IfRange = new RangeConditionHeaderValue(new EntityTagHeaderValue("\"Etag\"")); 170var entityTag = new EntityTagHeaderValue("\"Etag\""); 177new EntityTagHeaderValue("\"Etag\""), 180requestHeaders.IfRange = new RangeConditionHeaderValue(new EntityTagHeaderValue("\"NotEtag\"")); 207var entityTag = new EntityTagHeaderValue("\"Etag\""); 238var entityTag = new EntityTagHeaderValue("\"Etag\""); 270var entityTag = new EntityTagHeaderValue("\"Etag\""); 277new EntityTagHeaderValue("\"NotEtag\""), 304var entityTag = new EntityTagHeaderValue("\"Etag\""); 311new EntityTagHeaderValue("\"Etag\""),
src\Shared\ResultsTests\FileStreamResultTestBase.cs (17)
34var entityTag = new EntityTagHeaderValue("\"Etag\""); 44new EntityTagHeaderValue("\"Etag\""), 76var entityTag = new EntityTagHeaderValue("\"Etag\""); 85new EntityTagHeaderValue("\"Etag\""), 88requestHeaders.IfRange = new RangeConditionHeaderValue(new EntityTagHeaderValue("\"Etag\"")); 117var entityTag = new EntityTagHeaderValue("\"Etag\""); 126new EntityTagHeaderValue("\"Etag\""), 154var entityTag = new EntityTagHeaderValue("\"Etag\""); 163new EntityTagHeaderValue("\"Etag\""), 194var entityTag = new EntityTagHeaderValue("\"Etag\""); 227var entityTag = new EntityTagHeaderValue("\"Etag\""); 261var entityTag = new EntityTagHeaderValue("\"Etag\""); 269new EntityTagHeaderValue("\"NotEtag\""), 297var entityTag = new EntityTagHeaderValue("\"Etag\""); 305new EntityTagHeaderValue("\"Etag\""), 336var entityTag = new EntityTagHeaderValue("\"Etag\""); 347new EntityTagHeaderValue("\"Etag\""),
src\Shared\ResultsTests\PhysicalFileResultTestBase.cs (6)
70var entityTag = new EntityTagHeaderValue("\"Etag\""); 77requestHeaders.IfRange = new RangeConditionHeaderValue(new EntityTagHeaderValue("\"Etag\"")); 102var entityTag = new EntityTagHeaderValue("\"Etag\""); 109requestHeaders.IfRange = new RangeConditionHeaderValue(new EntityTagHeaderValue("\"Etag\"")); 129var entityTag = new EntityTagHeaderValue("\"Etag\""); 136requestHeaders.IfRange = new RangeConditionHeaderValue(new EntityTagHeaderValue("\"NotEtag\""));
src\Shared\ResultsTests\VirtualFileResultTestBase.cs (6)
91var entityTag = new EntityTagHeaderValue("\"Etag\""); 95requestHeaders.IfRange = new RangeConditionHeaderValue(new EntityTagHeaderValue("\"Etag\"")); 128var entityTag = new EntityTagHeaderValue("\"Etag\""); 132requestHeaders.IfRange = new RangeConditionHeaderValue(new EntityTagHeaderValue("\"Etag\"")); 161var entityTag = new EntityTagHeaderValue("\"Etag\""); 165requestHeaders.IfRange = new RangeConditionHeaderValue(new EntityTagHeaderValue("\"NotEtag\""));
Microsoft.AspNetCore.OutputCaching.Tests (11)
OutputCacheMiddlewareTests.cs (8)
309{ new EntityTagHeaderValue("\"tag\""), new EntityTagHeaderValue("\"tag\"") }, 310{ new EntityTagHeaderValue("\"tag\"", true), new EntityTagHeaderValue("\"tag\"") }, 311{ new EntityTagHeaderValue("\"tag\""), new EntityTagHeaderValue("\"tag\"", true) }, 312{ new EntityTagHeaderValue("\"tag\"", true), new EntityTagHeaderValue("\"tag\"", true) }
OutputCacheTests.cs (3)
697context.Response.GetTypedHeaders().ETag = new EntityTagHeaderValue("\"E1\""); 746context.Response.GetTypedHeaders().ETag = new EntityTagHeaderValue("\"E1\""); 772var builders = TestUtils.CreateBuildersWithOutputCaching(contextAction: context => context.Response.GetTypedHeaders().ETag = new EntityTagHeaderValue("\"E1\""));
Microsoft.AspNetCore.ResponseCaching.Tests (11)
ResponseCachingMiddlewareTests.cs (8)
306{ new EntityTagHeaderValue("\"tag\""), new EntityTagHeaderValue("\"tag\"") }, 307{ new EntityTagHeaderValue("\"tag\"", true), new EntityTagHeaderValue("\"tag\"") }, 308{ new EntityTagHeaderValue("\"tag\""), new EntityTagHeaderValue("\"tag\"", true) }, 309{ new EntityTagHeaderValue("\"tag\"", true), new EntityTagHeaderValue("\"tag\"", true) }
ResponseCachingTests.cs (3)
643context.Response.GetTypedHeaders().ETag = new EntityTagHeaderValue("\"E1\""); 696context.Response.GetTypedHeaders().ETag = new EntityTagHeaderValue("\"E1\""); 724var builders = TestUtils.CreateBuildersWithResponseCaching(contextAction: context => context.Response.GetTypedHeaders().ETag = new EntityTagHeaderValue("\"E1\""));
Microsoft.AspNetCore.StaticFiles (1)
StaticFileContext.cs (1)
127_etag = new EntityTagHeaderValue('\"' + Convert.ToString(etagHash, 16) + '\"');
Microsoft.Net.Http.Headers (3)
EntityTagHeaderValue.cs (2)
75public static EntityTagHeaderValue Any { get; } = new EntityTagHeaderValue("*", isWeak: false); 254parsedValue = new EntityTagHeaderValue();
RangeConditionHeaderValue.cs (1)
51: this(new EntityTagHeaderValue(entityTag))
Microsoft.Net.Http.Headers.Tests (118)
EntityTagHeaderValueTest.cs (104)
11Assert.Throws<ArgumentException>(() => new EntityTagHeaderValue(null)); 13Assert.Throws<ArgumentException>(() => new EntityTagHeaderValue(string.Empty)); 34var etag = new EntityTagHeaderValue("\"tag\""); 42var etag = new EntityTagHeaderValue("\"e tag\"", true); 50var etag = new EntityTagHeaderValue("\"e tag\""); 53etag = new EntityTagHeaderValue("\"e tag\"", true); 56etag = new EntityTagHeaderValue("\"\"", false); 63var etag1 = new EntityTagHeaderValue("\"tag\""); 64var etag2 = new EntityTagHeaderValue("\"TAG\""); 65var etag3 = new EntityTagHeaderValue("\"tag\"", true); 66var etag4 = new EntityTagHeaderValue("\"tag1\""); 67var etag5 = new EntityTagHeaderValue("\"tag\""); 80var etag1 = new EntityTagHeaderValue("\"tag\""); 81var etag2 = new EntityTagHeaderValue("\"TAG\""); 82var etag3 = new EntityTagHeaderValue("\"tag\"", true); 83var etag4 = new EntityTagHeaderValue("\"tag1\""); 84var etag5 = new EntityTagHeaderValue("\"tag\""); 110{ new EntityTagHeaderValue("\"tag\""), new EntityTagHeaderValue("\"TAG\"") }, 111{ new EntityTagHeaderValue("\"tag\"", true), new EntityTagHeaderValue("\"tag\"", true) }, 112{ new EntityTagHeaderValue("\"tag\""), new EntityTagHeaderValue("\"tag\"", true) }, 113{ new EntityTagHeaderValue("\"tag\""), new EntityTagHeaderValue("\"tag1\"") }, 114{ new EntityTagHeaderValue("\"tag\""), EntityTagHeaderValue.Any }, 133{ new EntityTagHeaderValue("\"tag\""), new EntityTagHeaderValue("\"tag\"") }, 152{ new EntityTagHeaderValue("\"tag\""), new EntityTagHeaderValue("\"TAG\"") }, 153{ new EntityTagHeaderValue("\"tag\""), new EntityTagHeaderValue("\"tag1\"") }, 154{ new EntityTagHeaderValue("\"tag\""), EntityTagHeaderValue.Any }, 173{ new EntityTagHeaderValue("\"tag\""), new EntityTagHeaderValue("\"tag\"") }, 174{ new EntityTagHeaderValue("\"tag\"", true), new EntityTagHeaderValue("\"tag\"", true) }, 175{ new EntityTagHeaderValue("\"tag\""), new EntityTagHeaderValue("\"tag\"", true) }, 191CheckValidParse("\"tag\"", new EntityTagHeaderValue("\"tag\"")); 192CheckValidParse(" \"tag\" ", new EntityTagHeaderValue("\"tag\"")); 193CheckValidParse("\r\n \"tag\"\r\n ", new EntityTagHeaderValue("\"tag\"")); 194CheckValidParse("\"tag\"", new EntityTagHeaderValue("\"tag\"")); 195CheckValidParse("\"tag会\"", new EntityTagHeaderValue("\"tag会\"")); 196CheckValidParse("W/\"tag\"", new EntityTagHeaderValue("\"tag\"", true)); 197CheckValidParse("*", new EntityTagHeaderValue("*")); 220CheckValidTryParse("\"tag\"", new EntityTagHeaderValue("\"tag\"")); 221CheckValidTryParse(" \"tag\" ", new EntityTagHeaderValue("\"tag\"")); 222CheckValidTryParse("\r\n \"tag\"\r\n ", new EntityTagHeaderValue("\"tag\"")); 223CheckValidTryParse("\"tag\"", new EntityTagHeaderValue("\"tag\"")); 224CheckValidTryParse("\"tag会\"", new EntityTagHeaderValue("\"tag会\"")); 225CheckValidTryParse("W/\"tag\"", new EntityTagHeaderValue("\"tag\"", true)); 226CheckValidTryParse("*", new EntityTagHeaderValue("*")); 286new EntityTagHeaderValue("\"tag\""), 287new EntityTagHeaderValue("\"tag\""), 288new EntityTagHeaderValue("\"tag\""), 289new EntityTagHeaderValue("\"tag会\""), 290new EntityTagHeaderValue("\"tag\""), 291new EntityTagHeaderValue("\"tag\""), 292new EntityTagHeaderValue("\"tag\""), 293new EntityTagHeaderValue("\"tag\""), 294new EntityTagHeaderValue("\"tag\"", true), 319new EntityTagHeaderValue("\"tag\""), 320new EntityTagHeaderValue("\"tag\""), 321new EntityTagHeaderValue("\"tag\""), 322new EntityTagHeaderValue("\"tag会\""), 323new EntityTagHeaderValue("\"tag\""), 324new EntityTagHeaderValue("\"tag\""), 325new EntityTagHeaderValue("\"tag\""), 326new EntityTagHeaderValue("\"tag\""), 327new EntityTagHeaderValue("\"tag\"", true), 351new EntityTagHeaderValue("\"tag\""), 352new EntityTagHeaderValue("\"tag\""), 353new EntityTagHeaderValue("\"tag\""), 354new EntityTagHeaderValue("\"tag会\""), 355new EntityTagHeaderValue("\"tag\""), 356new EntityTagHeaderValue("\"tag\""), 357new EntityTagHeaderValue("\"tag\""), 358new EntityTagHeaderValue("\"tag\""), 359new EntityTagHeaderValue("\"tag\"", true), 383new EntityTagHeaderValue("\"tag\""), 384new EntityTagHeaderValue("\"tag\""), 385new EntityTagHeaderValue("\"tag\""), 386new EntityTagHeaderValue("\"tag会\""), 387new EntityTagHeaderValue("\"tag\""), 388new EntityTagHeaderValue("\"tag\""), 389new EntityTagHeaderValue("\"tag\""), 390new EntityTagHeaderValue("\"tag\""), 391new EntityTagHeaderValue("\"tag\"", true), 415new EntityTagHeaderValue("\"tag\""), 416new EntityTagHeaderValue("\"tag\""), 417new EntityTagHeaderValue("\"tag\""), 418new EntityTagHeaderValue("\"tag会\""), 419new EntityTagHeaderValue("\"tag\""), 420new EntityTagHeaderValue("\"tag\""), 421new EntityTagHeaderValue("\"tag\"", true), 463new EntityTagHeaderValue("\"tag\""), 464new EntityTagHeaderValue("\"tag\""), 465new EntityTagHeaderValue("\"tag\""), 466new EntityTagHeaderValue("\"tag会\""), 467new EntityTagHeaderValue("\"tag\""), 468new EntityTagHeaderValue("\"tag\""), 469new EntityTagHeaderValue("\"tag\"", true), 518Assert.Throws<FormatException>(() => new EntityTagHeaderValue(tag));
RangeConditionHeaderValueTest.cs (14)
11var rangeCondition = new RangeConditionHeaderValue(new EntityTagHeaderValue("\"x\"")); 12Assert.Equal(new EntityTagHeaderValue("\"x\""), rangeCondition.EntityTag); 23Assert.Equal(new EntityTagHeaderValue("\"y\""), rangeCondition.EntityTag); 41var rangeCondition = new RangeConditionHeaderValue(new EntityTagHeaderValue("\"x\"")); 52var rangeCondition2 = new RangeConditionHeaderValue(new EntityTagHeaderValue("\"x\"")); 60new EntityTagHeaderValue("\"x\"", true)); 73var rangeCondition2 = new RangeConditionHeaderValue(new EntityTagHeaderValue("\"x\"")); 81new EntityTagHeaderValue("\"x\"", true)); 100CheckValidParse(" W/ \"tag\" ", new RangeConditionHeaderValue(new EntityTagHeaderValue("\"tag\"", true))); 101CheckValidParse(" w/\"tag\"", new RangeConditionHeaderValue(new EntityTagHeaderValue("\"tag\"", true))); 102CheckValidParse("\"tag\"", new RangeConditionHeaderValue(new EntityTagHeaderValue("\"tag\""))); 129CheckValidTryParse(" W/ \"tag\" ", new RangeConditionHeaderValue(new EntityTagHeaderValue("\"tag\"", true))); 130CheckValidTryParse(" w/\"tag\"", new RangeConditionHeaderValue(new EntityTagHeaderValue("\"tag\"", true))); 131CheckValidTryParse("\"tag\"", new RangeConditionHeaderValue(new EntityTagHeaderValue("\"tag\"")));
408 references to EntityTagHeaderValue
FilesWebSite (4)
Controllers\DownloadFilesController.cs (4)
31var entityTag = new EntityTagHeaderValue("\"Etag\""); 45var entityTag = new EntityTagHeaderValue("\"Etag\""); 93var entityTag = new EntityTagHeaderValue("\"Etag\""); 112var entityTag = new EntityTagHeaderValue("\"Etag\"");
Microsoft.AspNetCore.HeaderParsing (7)
CommonHeaders.cs (3)
65public static HeaderSetup<IReadOnlyList<EntityTagHeaderValue>> IfMatch => new(HeaderNames.IfMatch, EntityTagHeaderValueListParser.Instance); 70public static HeaderSetup<IReadOnlyList<EntityTagHeaderValue>> IfModifiedSince => new(HeaderNames.IfModifiedSince, EntityTagHeaderValueListParser.Instance); 75public static HeaderSetup<IReadOnlyList<EntityTagHeaderValue>> IfNoneMatch => new(HeaderNames.IfNoneMatch, EntityTagHeaderValueListParser.Instance);
Parsers\EntityTagHeaderValueListParser.cs (4)
11internal sealed class EntityTagHeaderValueListParser : HeaderParser<IReadOnlyList<EntityTagHeaderValue>> 15public override bool TryParse(StringValues values, [NotNullWhen(true)] out IReadOnlyList<EntityTagHeaderValue>? result, [NotNullWhen(false)] out string? error) 17if (!EntityTagHeaderValue.TryParseList(values, out var parsedValues)) 25result = (IReadOnlyList<EntityTagHeaderValue>)parsedValues;
Microsoft.AspNetCore.Http.Extensions (14)
HeaderDictionaryTypeExtensions.cs (8)
147private static EntityTagHeaderValue? ParseCacheEntityTagHeaderValue(string value) => EntityTagHeaderValue.TryParse(value, out var result) ? result : null; 162private static IList<EntityTagHeaderValue> ParseEntityTagHeaderValue(IList<string> value) => 163EntityTagHeaderValue.TryParseList(value, out var result) ? result : Array.Empty<EntityTagHeaderValue>(); 204else if (typeof(T) == typeof(EntityTagHeaderValue)) 249else if (typeof(T) == typeof(EntityTagHeaderValue))
RequestHeaders.cs (4)
229public IList<EntityTagHeaderValue> IfMatch 233return Headers.IfMatch.GetList<EntityTagHeaderValue>(); 259public IList<EntityTagHeaderValue> IfNoneMatch 263return Headers.IfNoneMatch.GetList<EntityTagHeaderValue>();
ResponseHeaders.cs (2)
124public EntityTagHeaderValue? ETag 128return Headers.Get<EntityTagHeaderValue>(HeaderNames.ETag);
Microsoft.AspNetCore.Http.Extensions.Tests (5)
HeaderDictionaryTypeExtensionsTest.cs (5)
97var result = context.Request.GetTypedHeaders().Get<EntityTagHeaderValue>(HeaderNames.ETag); 99var expected = new EntityTagHeaderValue("\"123\""); 231var result = context.Request.GetTypedHeaders().GetList<EntityTagHeaderValue>(HeaderNames.ETag); 233List<EntityTagHeaderValue> expected = [new("\"123\"", false), new("\"456\"", false)];
Microsoft.AspNetCore.Http.Results (71)
FileContentHttpResult.cs (3)
53/// <param name="entityTag">The <see cref="EntityTagHeaderValue"/> associated with the file.</param> 60EntityTagHeaderValue? entityTag = null) 89public EntityTagHeaderValue? EntityTag { get; internal init; }
FileStreamHttpResult.cs (3)
53/// <param name="entityTag">The <see cref="EntityTagHeaderValue"/> associated with the file.</param> 60EntityTagHeaderValue? entityTag = null) 95public EntityTagHeaderValue? EntityTag { get; internal init; }
HttpResultsHelper.cs (1)
99EntityTagHeaderValue? entityTag)
PhysicalFileHttpResult.cs (3)
51/// <param name="entityTag">The <see cref="EntityTagHeaderValue"/> associated with the file.</param> 58EntityTagHeaderValue? entityTag = null) 86public EntityTagHeaderValue? EntityTag { get; internal init; }
PushStreamHttpResult.cs (3)
53/// <param name="entityTag">The <see cref="EntityTagHeaderValue"/> associated with the file.</param> 60EntityTagHeaderValue? entityTag = null) 88public EntityTagHeaderValue? EntityTag { get; internal init; }
Results.cs (20)
284/// This API is an alias for <see cref="Bytes(byte[], string, string?, bool, DateTimeOffset?, EntityTagHeaderValue?)"/>.</para> 291/// <param name="entityTag">The <see cref="EntityTagHeaderValue"/> associated with the file.</param> 299EntityTagHeaderValue? entityTag = null) 309/// This API is an alias for <see cref="File(byte[], string, string?, bool, DateTimeOffset?, EntityTagHeaderValue?)"/>.</para> 316/// <param name="entityTag">The <see cref="EntityTagHeaderValue"/> associated with the file.</param> 324EntityTagHeaderValue? entityTag = null) 339/// <param name="entityTag">The <see cref="EntityTagHeaderValue"/> associated with the file.</param> 347EntityTagHeaderValue? entityTag = null) 357/// This API is an alias for <see cref="Stream(Stream, string, string?, DateTimeOffset?, EntityTagHeaderValue?, bool)"/>. 365/// <param name="entityTag">The <see cref="EntityTagHeaderValue"/> to be configure the <c>ETag</c> response header 377EntityTagHeaderValue? entityTag = null, 388/// This API is an alias for <see cref="File(Stream, string, string?, DateTimeOffset?, EntityTagHeaderValue?, bool)"/>. 396/// <param name="entityTag">The <see cref="EntityTagHeaderValue"/> to be configure the <c>ETag</c> response header 408EntityTagHeaderValue? entityTag = null, 424/// <param name="entityTag">The <see cref="EntityTagHeaderValue"/> to be configure the <c>ETag</c> response header 436EntityTagHeaderValue? entityTag = null, 448/// <param name="entityTag">The <see cref="EntityTagHeaderValue"/> to be configure the <c>ETag</c> response header 456EntityTagHeaderValue? entityTag = null) 470/// <param name="entityTag">The <see cref="EntityTagHeaderValue"/> associated with the file.</param> 478EntityTagHeaderValue? entityTag = null,
src\Shared\ResultsHelpers\FileResultHelper.cs (11)
96EntityTagHeaderValue? etag, 164EntityTagHeaderValue? etag, 197EntityTagHeaderValue? etag, 263IList<EntityTagHeaderValue> etagHeader, 264EntityTagHeaderValue etag, 271foreach (var entityTag in etagHeader) 273if (entityTag.Equals(EntityTagHeaderValue.Any) || entityTag.Compare(etag, useStrongComparison)) 358private static void SetLastModifiedAndEtagHeaders(HttpResponse response, DateTimeOffset? lastModified, EntityTagHeaderValue? etag) 404public static partial void IfMatchPreconditionFailed(ILogger logger, EntityTagHeaderValue currentETag); 427EntityTagHeaderValue currentETag, 428EntityTagHeaderValue IfRangeETag);
src\Shared\ResultsHelpers\FileResultInfo.cs (1)
17public EntityTagHeaderValue? EntityTag { get; init; }
src\Shared\ResultsHelpers\FileResultLogging.cs (1)
15void IfMatchPreconditionFailed(EntityTagHeaderValue etag);
TypedResults.cs (22)
248/// This API is an alias for <see cref="Bytes(byte[], string, string?, bool, DateTimeOffset?, EntityTagHeaderValue?)"/>.</para> 255/// <param name="entityTag">The <see cref="EntityTagHeaderValue"/> associated with the file.</param> 263EntityTagHeaderValue? entityTag = null) 283/// This API is an alias for <see cref="File(byte[], string, string?, bool, DateTimeOffset?, EntityTagHeaderValue?)"/>.</para> 290/// <param name="entityTag">The <see cref="EntityTagHeaderValue"/> associated with the file.</param> 298EntityTagHeaderValue? entityTag = null) 323/// <param name="entityTag">The <see cref="EntityTagHeaderValue"/> associated with the file.</param> 331EntityTagHeaderValue? entityTag = null) 347/// This API is an alias for <see cref="Stream(Stream, string, string?, DateTimeOffset?, EntityTagHeaderValue?, bool)"/>. 358/// <param name="entityTag">The <see cref="EntityTagHeaderValue"/> to be configure the <c>ETag</c> response header 367EntityTagHeaderValue? entityTag = null, 388/// This API is an alias for <see cref="File(Stream, string, string?, DateTimeOffset?, EntityTagHeaderValue?, bool)"/>. 399/// <param name="entityTag">The <see cref="EntityTagHeaderValue"/> to be configure the <c>ETag</c> response header 408EntityTagHeaderValue? entityTag = null, 437/// <param name="entityTag">The <see cref="EntityTagHeaderValue"/> to be configure the <c>ETag</c> response header 446EntityTagHeaderValue? entityTag = null, 468/// <param name="entityTag">The <see cref="EntityTagHeaderValue"/> to be configure the <c>ETag</c> response header 476EntityTagHeaderValue? entityTag = null) 499/// <param name="entityTag">The <see cref="EntityTagHeaderValue"/> associated with the file.</param> 507EntityTagHeaderValue? entityTag = null, 532/// <param name="entityTag">The <see cref="EntityTagHeaderValue"/> associated with the file.</param> 540EntityTagHeaderValue? entityTag = null,
VirtualFileHttpResult.cs (3)
56/// <param name="entityTag">The <see cref="EntityTagHeaderValue"/> associated with the file.</param> 63EntityTagHeaderValue? entityTag = null) 83public EntityTagHeaderValue? EntityTag { get; internal init; }
Microsoft.AspNetCore.Http.Results.Tests (63)
FileContentResultTests.cs (1)
19EntityTagHeaderValue entityTag = null,
HttpFileStreamResultTests.cs (2)
16EntityTagHeaderValue entityTag = null, 66var entityTag = new EntityTagHeaderValue("\"Etag\"");
PhysicalFileResultTest.cs (1)
16EntityTagHeaderValue entityTag = null,
PushStreamResultTests.cs (1)
54var entityTag = new EntityTagHeaderValue("\"Etag\"");
ResultsTests.cs (12)
262public void BytesOrFile_ResultHasCorrectValues(int bytesOrFile, string contentType, string fileDownloadName, bool enableRangeProcessing, DateTimeOffset lastModified, EntityTagHeaderValue entityTag) 285new object[] { 0, "text/plain", "testfile", true, new DateTimeOffset(2022, 1, 1, 0, 0, 1, TimeSpan.FromHours(-8)), EntityTagHeaderValue.Any }, 286new object[] { 0, default(string), default(string), default(bool), default(DateTimeOffset?), default(EntityTagHeaderValue) }, 287new object[] { 1, "text/plain", "testfile", true, new DateTimeOffset(2022, 1, 1, 0, 0, 1, TimeSpan.FromHours(-8)), EntityTagHeaderValue.Any }, 288new object[] { 1, default(string), default(string), default(bool), default(DateTimeOffset?), default(EntityTagHeaderValue) } 293public void Stream_ResultHasCorrectValues(int overload, string contentType, string fileDownloadName, bool enableRangeProcessing, DateTimeOffset lastModified, EntityTagHeaderValue entityTag) 333new object[] { 0, "text/plain", "testfile", true, new DateTimeOffset(2022, 1, 1, 0, 0, 1, TimeSpan.FromHours(-8)), EntityTagHeaderValue.Any }, 334new object[] { 0, default(string), default(string), default(bool), default(DateTimeOffset?), default(EntityTagHeaderValue) }, 335new object[] { 1, "text/plain", "testfile", true, new DateTimeOffset(2022, 1, 1, 0, 0, 1, TimeSpan.FromHours(-8)), EntityTagHeaderValue.Any }, 336new object[] { 1, default(string), default(string), default(bool), default(DateTimeOffset?), default(EntityTagHeaderValue) }, 337new object[] { 2, "text/plain", "testfile", true, new DateTimeOffset(2022, 1, 1, 0, 0, 1, TimeSpan.FromHours(-8)), EntityTagHeaderValue.Any }, 338new object[] { 2, default(string), default(string), default(bool), default(DateTimeOffset?), default(EntityTagHeaderValue) }
src\Shared\ResultsTests\FileContentResultTestBase.cs (9)
24EntityTagHeaderValue entityTag = null, 58var entityTag = new EntityTagHeaderValue("\"Etag\""); 97var entityTag = new EntityTagHeaderValue("\"Etag\""); 136var entityTag = new EntityTagHeaderValue("\"Etag\""); 170var entityTag = new EntityTagHeaderValue("\"Etag\""); 207var entityTag = new EntityTagHeaderValue("\"Etag\""); 238var entityTag = new EntityTagHeaderValue("\"Etag\""); 270var entityTag = new EntityTagHeaderValue("\"Etag\""); 304var entityTag = new EntityTagHeaderValue("\"Etag\"");
src\Shared\ResultsTests\FileStreamResultTestBase.cs (10)
21EntityTagHeaderValue entityTag = null, 34var entityTag = new EntityTagHeaderValue("\"Etag\""); 76var entityTag = new EntityTagHeaderValue("\"Etag\""); 117var entityTag = new EntityTagHeaderValue("\"Etag\""); 154var entityTag = new EntityTagHeaderValue("\"Etag\""); 194var entityTag = new EntityTagHeaderValue("\"Etag\""); 227var entityTag = new EntityTagHeaderValue("\"Etag\""); 261var entityTag = new EntityTagHeaderValue("\"Etag\""); 297var entityTag = new EntityTagHeaderValue("\"Etag\""); 336var entityTag = new EntityTagHeaderValue("\"Etag\"");
src\Shared\ResultsTests\PhysicalFileResultTestBase.cs (4)
27EntityTagHeaderValue entityTag = null, 70var entityTag = new EntityTagHeaderValue("\"Etag\""); 102var entityTag = new EntityTagHeaderValue("\"Etag\""); 129var entityTag = new EntityTagHeaderValue("\"Etag\"");
src\Shared\ResultsTests\VirtualFileResultTestBase.cs (4)
30EntityTagHeaderValue entityTag = null, 91var entityTag = new EntityTagHeaderValue("\"Etag\""); 128var entityTag = new EntityTagHeaderValue("\"Etag\""); 161var entityTag = new EntityTagHeaderValue("\"Etag\"");
TypedResultsTests.cs (18)
240public void BytesOrFile_ResultHasCorrectValues(int bytesOrFile, string contentType, string fileDownloadName, bool enableRangeProcessing, DateTimeOffset lastModified, EntityTagHeaderValue entityTag) 263new object[] { 0, "text/plain", "testfile", true, new DateTimeOffset(2022, 1, 1, 0, 0, 1, TimeSpan.FromHours(-8)), EntityTagHeaderValue.Any }, 264new object[] { 0, default(string), default(string), default(bool), default(DateTimeOffset?), default(EntityTagHeaderValue) }, 265new object[] { 1, "text/plain", "testfile", true, new DateTimeOffset(2022, 1, 1, 0, 0, 1, TimeSpan.FromHours(-8)), EntityTagHeaderValue.Any }, 266new object[] { 1, default(string), default(string), default(bool), default(DateTimeOffset?), default(EntityTagHeaderValue) } 271public void PhysicalFile_ResultHasCorrectValues(string contentType, string fileDownloadName, bool enableRangeProcessing, DateTimeOffset lastModified, EntityTagHeaderValue entityTag) 290public void VirtualFile_ResultHasCorrectValues(string contentType, string fileDownloadName, bool enableRangeProcessing, DateTimeOffset lastModified, EntityTagHeaderValue entityTag) 309new object[] { "text/plain", "testfile", true, new DateTimeOffset(2022, 1, 1, 0, 0, 1, TimeSpan.FromHours(-8)), EntityTagHeaderValue.Any }, 310new object[] { default(string), default(string), default(bool), default(DateTimeOffset?), default(EntityTagHeaderValue) }, 311new object[] { "text/plain", "testfile", true, new DateTimeOffset(2022, 1, 1, 0, 0, 1, TimeSpan.FromHours(-8)), EntityTagHeaderValue.Any }, 312new object[] { default(string), default(string), default(bool), default(DateTimeOffset?), default(EntityTagHeaderValue) } 377public void Stream_ResultHasCorrectValues(int overload, string contentType, string fileDownloadName, bool enableRangeProcessing, DateTimeOffset lastModified, EntityTagHeaderValue entityTag) 417new object[] { 0, "text/plain", "testfile", true, new DateTimeOffset(2022, 1, 1, 0, 0, 1, TimeSpan.FromHours(-8)), EntityTagHeaderValue.Any }, 418new object[] { 0, default(string), default(string), default(bool), default(DateTimeOffset?), default(EntityTagHeaderValue) }, 419new object[] { 1, "text/plain", "testfile", true, new DateTimeOffset(2022, 1, 1, 0, 0, 1, TimeSpan.FromHours(-8)), EntityTagHeaderValue.Any }, 420new object[] { 1, default(string), default(string), default(bool), default(DateTimeOffset?), default(EntityTagHeaderValue) }, 421new object[] { 2, "text/plain", "testfile", true, new DateTimeOffset(2022, 1, 1, 0, 0, 1, TimeSpan.FromHours(-8)), EntityTagHeaderValue.Any }, 422new object[] { 2, default(string), default(string), default(bool), default(DateTimeOffset?), default(EntityTagHeaderValue) }
VirtualFileResultTests.cs (1)
11protected override Task ExecuteAsync(HttpContext httpContext, string path, string contentType, DateTimeOffset? lastModified = null, EntityTagHeaderValue entityTag = null, bool enableRangeProcessing = false)
Microsoft.AspNetCore.Mvc.Core (48)
ControllerBase.cs (32)
1133/// <param name="entityTag">The <see cref="EntityTagHeaderValue"/> associated with the file.</param> 1136public virtual FileContentResult File(byte[] fileContents, string contentType, DateTimeOffset? lastModified, EntityTagHeaderValue entityTag) 1154/// <param name="entityTag">The <see cref="EntityTagHeaderValue"/> associated with the file.</param> 1158public virtual FileContentResult File(byte[] fileContents, string contentType, DateTimeOffset? lastModified, EntityTagHeaderValue entityTag, bool enableRangeProcessing) 1178/// <param name="entityTag">The <see cref="EntityTagHeaderValue"/> associated with the file.</param> 1181public virtual FileContentResult File(byte[] fileContents, string contentType, string? fileDownloadName, DateTimeOffset? lastModified, EntityTagHeaderValue entityTag) 1201/// <param name="entityTag">The <see cref="EntityTagHeaderValue"/> associated with the file.</param> 1205public virtual FileContentResult File(byte[] fileContents, string contentType, string? fileDownloadName, DateTimeOffset? lastModified, EntityTagHeaderValue entityTag, bool enableRangeProcessing) 1299/// <param name="entityTag">The <see cref="EntityTagHeaderValue"/> associated with the file.</param> 1305public virtual FileStreamResult File(Stream fileStream, string contentType, DateTimeOffset? lastModified, EntityTagHeaderValue entityTag) 1323/// <param name="entityTag">The <see cref="EntityTagHeaderValue"/> associated with the file.</param> 1330public virtual FileStreamResult File(Stream fileStream, string contentType, DateTimeOffset? lastModified, EntityTagHeaderValue entityTag, bool enableRangeProcessing) 1350/// <param name="entityTag">The <see cref="EntityTagHeaderValue"/> associated with the file.</param> 1356public virtual FileStreamResult File(Stream fileStream, string contentType, string? fileDownloadName, DateTimeOffset? lastModified, EntityTagHeaderValue entityTag) 1376/// <param name="entityTag">The <see cref="EntityTagHeaderValue"/> associated with the file.</param> 1383public virtual FileStreamResult File(Stream fileStream, string contentType, string? fileDownloadName, DateTimeOffset? lastModified, EntityTagHeaderValue entityTag, bool enableRangeProcessing) 1465/// <param name="entityTag">The <see cref="EntityTagHeaderValue"/> associated with the file.</param> 1468public virtual VirtualFileResult File(string virtualPath, string contentType, DateTimeOffset? lastModified, EntityTagHeaderValue entityTag) 1486/// <param name="entityTag">The <see cref="EntityTagHeaderValue"/> associated with the file.</param> 1490public virtual VirtualFileResult File(string virtualPath, string contentType, DateTimeOffset? lastModified, EntityTagHeaderValue entityTag, bool enableRangeProcessing) 1510/// <param name="entityTag">The <see cref="EntityTagHeaderValue"/> associated with the file.</param> 1513public virtual VirtualFileResult File(string virtualPath, string contentType, string? fileDownloadName, DateTimeOffset? lastModified, EntityTagHeaderValue entityTag) 1533/// <param name="entityTag">The <see cref="EntityTagHeaderValue"/> associated with the file.</param> 1537public virtual VirtualFileResult File(string virtualPath, string contentType, string? fileDownloadName, DateTimeOffset? lastModified, EntityTagHeaderValue entityTag, bool enableRangeProcessing) 1626/// <param name="entityTag">The <see cref="EntityTagHeaderValue"/> associated with the file.</param> 1629public virtual PhysicalFileResult PhysicalFile(string physicalPath, string contentType, DateTimeOffset? lastModified, EntityTagHeaderValue entityTag) 1647/// <param name="entityTag">The <see cref="EntityTagHeaderValue"/> associated with the file.</param> 1651public virtual PhysicalFileResult PhysicalFile(string physicalPath, string contentType, DateTimeOffset? lastModified, EntityTagHeaderValue entityTag, bool enableRangeProcessing) 1671/// <param name="entityTag">The <see cref="EntityTagHeaderValue"/> associated with the file.</param> 1674public virtual PhysicalFileResult PhysicalFile(string physicalPath, string contentType, string? fileDownloadName, DateTimeOffset? lastModified, EntityTagHeaderValue entityTag) 1694/// <param name="entityTag">The <see cref="EntityTagHeaderValue"/> associated with the file.</param> 1698public virtual PhysicalFileResult PhysicalFile(string physicalPath, string contentType, string? fileDownloadName, DateTimeOffset? lastModified, EntityTagHeaderValue entityTag, bool enableRangeProcessing)
FileResult.cs (1)
52public EntityTagHeaderValue? EntityTag { get; set; }
Infrastructure\FileResultExecutorBase.cs (2)
51/// <param name="etag">The <see cref="EntityTagHeaderValue"/>.</param> 59EntityTagHeaderValue? etag = null)
src\Shared\ResultsHelpers\FileResultHelper.cs (11)
96EntityTagHeaderValue? etag, 164EntityTagHeaderValue? etag, 197EntityTagHeaderValue? etag, 263IList<EntityTagHeaderValue> etagHeader, 264EntityTagHeaderValue etag, 271foreach (var entityTag in etagHeader) 273if (entityTag.Equals(EntityTagHeaderValue.Any) || entityTag.Compare(etag, useStrongComparison)) 358private static void SetLastModifiedAndEtagHeaders(HttpResponse response, DateTimeOffset? lastModified, EntityTagHeaderValue? etag) 404public static partial void IfMatchPreconditionFailed(ILogger logger, EntityTagHeaderValue currentETag); 427EntityTagHeaderValue currentETag, 428EntityTagHeaderValue IfRangeETag);
src\Shared\ResultsHelpers\FileResultInfo.cs (1)
17public EntityTagHeaderValue? EntityTag { get; init; }
src\Shared\ResultsHelpers\FileResultLogging.cs (1)
15void IfMatchPreconditionFailed(EntityTagHeaderValue etag);
Microsoft.AspNetCore.Mvc.Core.Test (42)
ControllerBaseTest.cs (6)
1709var entityTag = (entityTagString == null) ? null : new EntityTagHeaderValue(entityTagString); 1753var entityTag = (entityTagString == null) ? null : new EntityTagHeaderValue(entityTagString); 1797var entityTag = (entityTagString == null) ? null : new EntityTagHeaderValue(entityTagString); 1841var entityTag = (entityTagString == null) ? null : new EntityTagHeaderValue(entityTagString); 1895var entityTag = (entityTagString == null) ? null : new EntityTagHeaderValue(entityTagString); 1947var entityTag = (entityTagString == null) ? null : new EntityTagHeaderValue(entityTagString);
FileContentResultTest.cs (1)
23EntityTagHeaderValue entityTag = null,
FileResultHelperTest.cs (4)
252var etag = new EntityTagHeaderValue("\"Etag\""); 292var etag = new EntityTagHeaderValue("\"Etag\""); 330var etag = new EntityTagHeaderValue("\"Etag\""); 366var etag = new EntityTagHeaderValue("\"Etag\"");
FileStreamResultTest.cs (2)
21EntityTagHeaderValue entityTag = null, 77var entityTag = new EntityTagHeaderValue("\"Etag\"");
PhysicalFileResultTest.cs (1)
21EntityTagHeaderValue entityTag = null,
src\Shared\ResultsTests\FileContentResultTestBase.cs (9)
24EntityTagHeaderValue entityTag = null, 58var entityTag = new EntityTagHeaderValue("\"Etag\""); 97var entityTag = new EntityTagHeaderValue("\"Etag\""); 136var entityTag = new EntityTagHeaderValue("\"Etag\""); 170var entityTag = new EntityTagHeaderValue("\"Etag\""); 207var entityTag = new EntityTagHeaderValue("\"Etag\""); 238var entityTag = new EntityTagHeaderValue("\"Etag\""); 270var entityTag = new EntityTagHeaderValue("\"Etag\""); 304var entityTag = new EntityTagHeaderValue("\"Etag\"");
src\Shared\ResultsTests\FileStreamResultTestBase.cs (10)
21EntityTagHeaderValue entityTag = null, 34var entityTag = new EntityTagHeaderValue("\"Etag\""); 76var entityTag = new EntityTagHeaderValue("\"Etag\""); 117var entityTag = new EntityTagHeaderValue("\"Etag\""); 154var entityTag = new EntityTagHeaderValue("\"Etag\""); 194var entityTag = new EntityTagHeaderValue("\"Etag\""); 227var entityTag = new EntityTagHeaderValue("\"Etag\""); 261var entityTag = new EntityTagHeaderValue("\"Etag\""); 297var entityTag = new EntityTagHeaderValue("\"Etag\""); 336var entityTag = new EntityTagHeaderValue("\"Etag\"");
src\Shared\ResultsTests\PhysicalFileResultTestBase.cs (4)
27EntityTagHeaderValue entityTag = null, 70var entityTag = new EntityTagHeaderValue("\"Etag\""); 102var entityTag = new EntityTagHeaderValue("\"Etag\""); 129var entityTag = new EntityTagHeaderValue("\"Etag\"");
src\Shared\ResultsTests\VirtualFileResultTestBase.cs (4)
30EntityTagHeaderValue entityTag = null, 91var entityTag = new EntityTagHeaderValue("\"Etag\""); 128var entityTag = new EntityTagHeaderValue("\"Etag\""); 161var entityTag = new EntityTagHeaderValue("\"Etag\"");
VirtualFileResultTest.cs (1)
81protected override Task ExecuteAsync(HttpContext httpContext, string path, string contentType, DateTimeOffset? lastModified = null, EntityTagHeaderValue entityTag = null, bool enableRangeProcessing = false)
Microsoft.AspNetCore.OutputCaching (6)
LoggerExtensions.cs (1)
19internal static partial void NotModifiedIfNoneMatchMatched(this ILogger logger, EntityTagHeaderValue etag);
OutputCacheMiddleware.cs (5)
528if (ifNoneMatchHeader.Count == 1 && StringSegment.Equals(ifNoneMatchHeader[0], EntityTagHeaderValue.Any.Tag, StringComparison.OrdinalIgnoreCase)) 536&& EntityTagHeaderValue.TryParse(raw.ToString(), out var eTag) 537&& EntityTagHeaderValue.TryParseList(ifNoneMatchHeader, out var ifNoneMatchETags)) 541var requestETag = ifNoneMatchETags[i];
Microsoft.AspNetCore.OutputCaching.Tests (7)
OutputCacheMiddlewareTests.cs (7)
263context.HttpContext.Request.Headers.IfNoneMatch = EntityTagHeaderValue.Any.ToString(); 303public static TheoryData<EntityTagHeaderValue, EntityTagHeaderValue> EquivalentWeakETags 307return new TheoryData<EntityTagHeaderValue, EntityTagHeaderValue> 319public void ContentIsNotModified_IfNoneMatch_ExplicitWithMatch_True(EntityTagHeaderValue responseETag, EntityTagHeaderValue requestETag)
Microsoft.AspNetCore.ResponseCaching (6)
LoggerExtensions.cs (1)
86internal static partial void NotModifiedIfNoneMatchMatched(this ILogger logger, EntityTagHeaderValue etag);
ResponseCachingMiddleware.cs (5)
435if (ifNoneMatchHeader.Count == 1 && StringSegment.Equals(ifNoneMatchHeader[0], EntityTagHeaderValue.Any.Tag, StringComparison.OrdinalIgnoreCase)) 441EntityTagHeaderValue? eTag; 443&& EntityTagHeaderValue.TryParse(cachedResponseHeaders.ETag.ToString(), out eTag) 444&& EntityTagHeaderValue.TryParseList(ifNoneMatchHeader, out var ifNoneMatchEtags)) 448var requestETag = ifNoneMatchEtags[i];
Microsoft.AspNetCore.ResponseCaching.Tests (7)
ResponseCachingMiddlewareTests.cs (7)
264context.HttpContext.Request.Headers.IfNoneMatch = EntityTagHeaderValue.Any.ToString(); 300public static TheoryData<EntityTagHeaderValue, EntityTagHeaderValue> EquivalentWeakETags 304return new TheoryData<EntityTagHeaderValue, EntityTagHeaderValue> 316public void ContentIsNotModified_IfNoneMatch_ExplicitWithMatch_True(EntityTagHeaderValue responseETag, EntityTagHeaderValue requestETag)
Microsoft.AspNetCore.StaticAssets (14)
Development\StaticAssetDescriptorExtensions.cs (5)
38internal static EntityTagHeaderValue GetWeakETag(this StaticAssetDescriptor descriptor) 44var eTag = EntityTagHeaderValue.Parse(header.Value); 74var eTag = EntityTagHeaderValue.Parse(header.Value);
Development\StaticAssetDevelopmentRuntimeHandler.cs (1)
37var eTag = asset.GetWeakETag();
StaticAssetsInvoker.cs (8)
25private readonly EntityTagHeaderValue _etag; 54_etag = EntityTagHeaderValue.Parse(etag); 256private readonly EntityTagHeaderValue _etag; 264EntityTagHeaderValue entityTag, 308foreach (var etag in ifMatch) 310if (etag.Equals(EntityTagHeaderValue.Any) || etag.Compare(_etag, useStrongComparison: false)) 324foreach (var etag in ifNoneMatch) 326if (etag.Equals(EntityTagHeaderValue.Any) || etag.Compare(_etag, useStrongComparison: false))
Microsoft.AspNetCore.StaticFiles (5)
StaticFileContext.cs (5)
28private EntityTagHeaderValue? _etag; 152foreach (var etag in ifMatch) 154if (etag.Equals(EntityTagHeaderValue.Any) || etag.Compare(_etag, useStrongComparison: true)) 167foreach (var etag in ifNoneMatch) 169if (etag.Equals(EntityTagHeaderValue.Any) || etag.Compare(_etag, useStrongComparison: true))
Microsoft.Net.Http.Headers (38)
EntityTagHeaderValue.cs (32)
17private static readonly HttpHeaderParser<EntityTagHeaderValue> SingleValueParser 18= new GenericHeaderParser<EntityTagHeaderValue>(false, GetEntityTagLength); 23private static readonly HttpHeaderParser<EntityTagHeaderValue> MultipleValueParser 24= new GenericHeaderParser<EntityTagHeaderValue>(true, GetEntityTagLength); 35/// Initializes a new instance of the <see cref="EntityTagHeaderValue"/>. 37/// <param name="tag">A <see cref="StringSegment"/> that contains an <see cref="EntityTagHeaderValue"/>.</param> 44/// Initializes a new instance of the <see cref="EntityTagHeaderValue"/>. 46/// <param name="tag">A <see cref="StringSegment"/> that contains an <see cref="EntityTagHeaderValue"/>.</param> 75public static EntityTagHeaderValue Any { get; } = new EntityTagHeaderValue("*", isWeak: false); 98/// Check against another <see cref="EntityTagHeaderValue"/> for equality. 104/// <c>false</c> if the other value is null, is not an <see cref="EntityTagHeaderValue"/>, or if there is a mismatch of strength or tag between the two values. 109return obj is EntityTagHeaderValue other && _isWeak == other._isWeak && StringSegment.Equals(_tag, other._tag, StringComparison.Ordinal); 120/// Compares against another <see cref="EntityTagHeaderValue"/> to see if they match under the RFC specifications (<see href="https://tools.ietf.org/html/rfc7232#section-2.3.2"/>). 122/// <param name="other">The other <see cref="EntityTagHeaderValue"/> to compare against.</param> 125/// <c>true</c> if the <see cref="EntityTagHeaderValue"/> match for the given comparison type, 128public bool Compare(EntityTagHeaderValue? other, bool useStrongComparison) 146/// Parses <paramref name="input"/> as a <see cref="EntityTagHeaderValue"/> value. 150public static EntityTagHeaderValue Parse(StringSegment input) 157/// Attempts to parse the specified <paramref name="input"/> as a <see cref="EntityTagHeaderValue"/>. 161/// <returns><see langword="true"/> if input is a valid <see cref="EntityTagHeaderValue"/>, otherwise <see langword="false"/>.</returns> 162public static bool TryParse(StringSegment input, [NotNullWhen(true)] out EntityTagHeaderValue? parsedValue) 169/// Parses a sequence of inputs as a sequence of <see cref="EntityTagHeaderValue"/> values. 173public static IList<EntityTagHeaderValue> ParseList(IList<string>? inputs) 179/// Parses a sequence of inputs as a sequence of <see cref="EntityTagHeaderValue"/> values using string parsing rules. 183public static IList<EntityTagHeaderValue> ParseStrictList(IList<string>? inputs) 189/// Attempts to parse the sequence of values as a sequence of <see cref="EntityTagHeaderValue"/>. 193/// <returns><see langword="true"/> if all inputs are valid <see cref="EntityTagHeaderValue"/>, otherwise <see langword="false"/>.</returns> 194public static bool TryParseList(IList<string>? inputs, [NotNullWhen(true)] out IList<EntityTagHeaderValue>? parsedValues) 200/// Attempts to parse the sequence of values as a sequence of <see cref="EntityTagHeaderValue"/> using string parsing rules. 204/// <returns><see langword="true"/> if all inputs are valid <see cref="EntityTagHeaderValue"/>, otherwise <see langword="false"/>.</returns> 205public static bool TryParseStrictList(IList<string>? inputs, [NotNullWhen(true)] out IList<EntityTagHeaderValue>? parsedValues) 210internal static int GetEntityTagLength(StringSegment input, int startIndex, out EntityTagHeaderValue? parsedValue)
RangeConditionHeaderValue.cs (6)
19private EntityTagHeaderValue? _entityTag; 39public RangeConditionHeaderValue(EntityTagHeaderValue entityTag) 64/// Gets the <see cref="EntityTagHeaderValue"/> from header. 66public EntityTagHeaderValue? EntityTag 149EntityTagHeaderValue? entityTag = null; 159var entityTagLength = EntityTagHeaderValue.GetEntityTagLength(input, current, out entityTag);
Microsoft.Net.Http.Headers.Tests (71)
EntityTagHeaderValueTest.cs (70)
34var etag = new EntityTagHeaderValue("\"tag\""); 42var etag = new EntityTagHeaderValue("\"e tag\"", true); 50var etag = new EntityTagHeaderValue("\"e tag\""); 63var etag1 = new EntityTagHeaderValue("\"tag\""); 64var etag2 = new EntityTagHeaderValue("\"TAG\""); 65var etag3 = new EntityTagHeaderValue("\"tag\"", true); 66var etag4 = new EntityTagHeaderValue("\"tag1\""); 67var etag5 = new EntityTagHeaderValue("\"tag\""); 68var etag6 = EntityTagHeaderValue.Any; 80var etag1 = new EntityTagHeaderValue("\"tag\""); 81var etag2 = new EntityTagHeaderValue("\"TAG\""); 82var etag3 = new EntityTagHeaderValue("\"tag\"", true); 83var etag4 = new EntityTagHeaderValue("\"tag1\""); 84var etag5 = new EntityTagHeaderValue("\"tag\""); 85var etag6 = EntityTagHeaderValue.Any; 100Assert.False(EntityTagHeaderValue.Any.Compare(null, useStrongComparison: true)); 101Assert.False(EntityTagHeaderValue.Any.Compare(null, useStrongComparison: false)); 104public static TheoryData<EntityTagHeaderValue, EntityTagHeaderValue> NotEquivalentUnderStrongComparison 108return new TheoryData<EntityTagHeaderValue, EntityTagHeaderValue> 114{ new EntityTagHeaderValue("\"tag\""), EntityTagHeaderValue.Any }, 121public void CompareUsingStrongComparison_NonEquivalentPairs_ReturnFalse(EntityTagHeaderValue left, EntityTagHeaderValue right) 127public static TheoryData<EntityTagHeaderValue, EntityTagHeaderValue> EquivalentUnderStrongComparison 131return new TheoryData<EntityTagHeaderValue, EntityTagHeaderValue> 140public void CompareUsingStrongComparison_EquivalentPairs_ReturnTrue(EntityTagHeaderValue left, EntityTagHeaderValue right) 146public static TheoryData<EntityTagHeaderValue, EntityTagHeaderValue> NotEquivalentUnderWeakComparison 150return new TheoryData<EntityTagHeaderValue, EntityTagHeaderValue> 154{ new EntityTagHeaderValue("\"tag\""), EntityTagHeaderValue.Any }, 161public void CompareUsingWeakComparison_NonEquivalentPairs_ReturnFalse(EntityTagHeaderValue left, EntityTagHeaderValue right) 167public static TheoryData<EntityTagHeaderValue, EntityTagHeaderValue> EquivalentUnderWeakComparison 171return new TheoryData<EntityTagHeaderValue, EntityTagHeaderValue> 182public void CompareUsingWeakComparison_EquivalentPairs_ReturnTrue(EntityTagHeaderValue left, EntityTagHeaderValue right) 246var result = EntityTagHeaderValue.ParseList(null); 250result = EntityTagHeaderValue.ParseList(new string[0]); 254result = EntityTagHeaderValue.ParseList(new string[] { "" }); 262Assert.False(EntityTagHeaderValue.TryParseList(null, out var results)); 263Assert.False(EntityTagHeaderValue.TryParseList(new string[0], out results)); 264Assert.False(EntityTagHeaderValue.TryParseList(new string[] { "" }, out results)); 282IList<EntityTagHeaderValue> results = EntityTagHeaderValue.ParseList(inputs); 315IList<EntityTagHeaderValue> results = EntityTagHeaderValue.ParseStrictList(inputs); 348Assert.True(EntityTagHeaderValue.TryParseList(inputs, out var results)); 380Assert.True(EntityTagHeaderValue.TryParseStrictList(inputs, out var results)); 412var results = EntityTagHeaderValue.ParseList(inputs); 442Assert.Throws<FormatException>(() => EntityTagHeaderValue.ParseStrictList(inputs)); 460Assert.True(EntityTagHeaderValue.TryParseList(inputs, out var results)); 490Assert.False(EntityTagHeaderValue.TryParseStrictList(inputs, out var results)); 493private void CheckValidParse(string? input, EntityTagHeaderValue expectedResult) 495var result = EntityTagHeaderValue.Parse(input); 501Assert.Throws<FormatException>(() => EntityTagHeaderValue.Parse(input)); 504private void CheckValidTryParse(string? input, EntityTagHeaderValue expectedResult) 506Assert.True(EntityTagHeaderValue.TryParse(input, out var result)); 512Assert.False(EntityTagHeaderValue.TryParse(input, out var result));
RangeConditionHeaderValueTest.cs (1)
15EntityTagHeaderValue input = null!;