1 write to ParserInstance
Microsoft.AspNetCore.HeaderParsing (1)
HeaderSetup.cs (1)
60
ParserInstance
= Throw.IfNull(instance);
23 references to ParserInstance
Microsoft.AspNetCore.HeaderParsing (2)
HeaderRegistry.cs (1)
30
var parser = setup.
ParserInstance
?? (HeaderParser<T>)_provider.GetRequiredService(setup.ParserType!);
HeaderSetup.cs (1)
24
/// <remarks>Not <see langword="null"/> when <see cref="
ParserInstance
" /> is <see langword="null"/> and vice versa.</remarks>
Microsoft.AspNetCore.HeaderParsing.Tests (21)
CommonHeadersTests.cs (17)
16
Assert.Equal(HostHeaderValueParser.Instance, CommonHeaders.Host.
ParserInstance
);
24
Assert.Equal(MediaTypeHeaderValueListParser.Instance, CommonHeaders.Accept.
ParserInstance
);
32
Assert.Equal(StringWithQualityHeaderValueListParser.Instance, CommonHeaders.AcceptEncoding.
ParserInstance
);
40
Assert.Equal(StringWithQualityHeaderValueListParser.Instance, CommonHeaders.AcceptLanguage.
ParserInstance
);
48
Assert.Equal(CacheControlHeaderValueParser.Instance, CommonHeaders.CacheControl.
ParserInstance
);
56
Assert.Equal(ContentDispositionHeaderValueParser.Instance, CommonHeaders.ContentDisposition.
ParserInstance
);
64
Assert.Equal(MediaTypeHeaderValueParser.Instance, CommonHeaders.ContentType.
ParserInstance
);
72
Assert.Equal(CookieHeaderValueListParser.Instance, CommonHeaders.Cookie.
ParserInstance
);
80
Assert.Equal(DateTimeOffsetParser.Instance, CommonHeaders.Date.
ParserInstance
);
88
Assert.Equal(EntityTagHeaderValueListParser.Instance, CommonHeaders.IfMatch.
ParserInstance
);
96
Assert.Equal(EntityTagHeaderValueListParser.Instance, CommonHeaders.IfModifiedSince.
ParserInstance
);
104
Assert.Equal(EntityTagHeaderValueListParser.Instance, CommonHeaders.IfNoneMatch.
ParserInstance
);
112
Assert.Equal(RangeConditionHeaderValueParser.Instance, CommonHeaders.IfRange.
ParserInstance
);
120
Assert.Equal(DateTimeOffsetParser.Instance, CommonHeaders.IfUnmodifiedSince.
ParserInstance
);
128
Assert.Equal(RangeHeaderValueParser.Instance, CommonHeaders.Range.
ParserInstance
);
136
Assert.Equal(UriParser.Instance, CommonHeaders.Referer.
ParserInstance
);
144
Assert.Equal(IPAddressListParser.Instance, CommonHeaders.XForwardedFor.
ParserInstance
);
HeaderParsingExtensionsTests.cs (1)
81
var headerKey = new HeaderKey<DateTimeOffset>("Test", CommonHeaders.Date.
ParserInstance
!, 0);
HeaderRegistryTests.cs (1)
32
Assert.Equal(CommonHeaders.Date.
ParserInstance
, key.Parser);
HeaderSetupTests.cs (2)
20
Assert.Equal(DateTimeOffsetParser.Instance, sut.
ParserInstance
);
31
Assert.Null(sut.
ParserInstance
);