2 instantiations of HeaderKey
Microsoft.AspNetCore.HeaderParsing (2)
HeaderRegistry.cs (2)
55
return new
HeaderKey
<T>(id.HeaderName, parser, pos, maxCachedValues, parsedValue);
58
return new
HeaderKey
<T>(id.HeaderName, parser, pos, maxCachedValues);
37 references to HeaderKey
Microsoft.AspNetCore.HeaderParsing (10)
HeaderParsingFeature.cs (3)
43
public bool TryGetHeaderValue<T>(
HeaderKey
<T> header, [NotNullWhen(true)] out T? value)
57
public bool TryGetHeaderValue<T>(
HeaderKey
<T> header, [NotNullWhen(true)] out T? value, out ParsingResult result)
135
public bool Process(HeaderParsingFeature feature,
HeaderKey
<T> header, out T? value, out ParsingResult result)
HeaderParsingHttpRequestExtensions.cs (2)
45
public static bool TryGetHeaderValue<T>(this HttpRequest request,
HeaderKey
<T> header, [NotNullWhen(true)] out T? value)
62
public static bool TryGetHeaderValue<T>(this HttpRequest request,
HeaderKey
<T> header, [NotNullWhen(true)] out T? value, out ParsingResult result)
HeaderRegistry.cs (3)
27
public
HeaderKey
<T> Register<T>(HeaderSetup<T> setup)
32
return (
HeaderKey
<T>)_headerKeys.GetOrAdd(id, CreateKey<T>, parser);
35
private
HeaderKey
<T> CreateKey<T>(HeaderKeyIdentity id, HeaderParser<T> parser)
IHeaderRegistry.cs (2)
17
/// <returns>An <see cref="
HeaderKey
{T}"/> instance.</returns>
18
HeaderKey
<T> Register<T>(HeaderSetup<T> setup)
Microsoft.AspNetCore.HeaderParsing.Tests (27)
HeaderKeyTests.cs (5)
21
var
sut = new HeaderKey<DateTimeOffset>(TestHeaderName, DateTimeOffsetParser.Instance, TestHeaderPosition);
28
var
sut = new HeaderKey<DateTimeOffset>(TestHeaderName, DateTimeOffsetParser.Instance, TestHeaderPosition);
38
var
referenceTimeDefault = new HeaderKey<IReadOnlyList<IPAddress>>(TestHeaderName, IPAddressListParser.Instance, TestHeaderPosition);
39
var
valueTypeDefault = new HeaderKey<DateTimeOffset>(TestHeaderName, DateTimeOffsetParser.Instance, TestHeaderPosition);
51
var
sut = new HeaderKey<DateTimeOffset>(TestHeaderName, DateTimeOffsetParser.Instance, TestHeaderPosition, 0, _testHeaderDefaultValue);
HeaderParsingExtensionsTests.cs (3)
81
var
headerKey = new HeaderKey<DateTimeOffset>("Test", CommonHeaders.Date.ParserInstance!, 0);
109
var
dateHeaderKey = RegisterHeader(context, CommonHeaders.Date);
132
private static
HeaderKey
<T> RegisterHeader<T>(HttpContext context, HeaderSetup<T> setup)
HeaderParsingFeatureTests.cs (11)
48
var
key = Registry.Register(CommonHeaders.Date);
66
var
key = Registry.Register(CommonHeaders.Date);
76
var
key2 = Registry.Register(new HeaderSetup<DateTimeOffset>("Test", DateTimeOffsetParser.Instance));
94
var
key = Registry.Register(CommonHeaders.Date);
107
var
key = Registry.Register(CommonHeaders.Date);
124
var
key = Registry.Register(CommonHeaders.Date);
142
var
key = Registry.Register(CommonHeaders.Date);
168
var
firstHeaderKey = Registry.Register(new HeaderSetup<DateTimeOffset>("FirstHeader", DateTimeOffsetParser.Instance));
169
var
secondHeaderKey = Registry.Register(new HeaderSetup<DateTimeOffset>("SecondHeader", DateTimeOffsetParser.Instance));
170
var
thirdHeaderKey = Registry.Register(new HeaderSetup<DateTimeOffset>("ThirdHeader", DateTimeOffsetParser.Instance));
200
var
key = Registry.Register(CommonHeaders.CacheControl);
HeaderRegistryTests.cs (8)
29
var
key = registry.Register(CommonHeaders.Date);
46
var
key = registry.Register(CommonHeaders.Date);
69
var
key1 = registry.Register(CommonHeaders.Date);
70
var
key2 = registry.Register(CommonHeaders.Accept);
71
var
key3 = registry.Register(CommonHeaders.AcceptLanguage);
83
var
key1 = registry.Register(CommonHeaders.Date);
84
var
key2 = registry.Register(CommonHeaders.Date);
96
var
key = registry.Register(new HeaderSetup<DateTimeOffset>("MyDate", typeof(DateTimeOffsetParser)));