14 instantiations of FormKey
Microsoft.AspNetCore.Components.Endpoints (9)
FormMapping\FormDataReader.cs (7)
115
if (_formDictionaryKeysByPrefix.TryGetValue(new
FormKey
(_currentPrefixBuffer), out var foundKeys))
149
if (result.TryGetValue(new
FormKey
(prefix), out var foundKeys))
151
foundKeys.Add(new
FormKey
(keyValue));
155
result.Add(new
FormKey
(prefix), new HashSet<FormKey> { new
FormKey
(keyValue) });
246
var foundSingleValue = _readOnlyMemoryKeys.TryGetValue(new
FormKey
(_currentPrefixBuffer), out var result) || result.Count == 1;
260
_readOnlyMemoryKeys.TryGetValue(new
FormKey
(_currentPrefixBuffer), out values);
FormMapping\HttpContextFormValueMapper.cs (1)
128
dictionary.Add(new
FormKey
(key.AsMemory()), value);
FormMapping\PrefixResolver.cs (1)
34
return Array.BinarySearch(_sortedKeys, 0, _length, new
FormKey
(currentPrefixBuffer), FormKeyComparer.PrefixCriteria) >= 0;
Microsoft.AspNetCore.Components.Endpoints.Tests (5)
Binding\FormDataMapperTests.cs (1)
83
dictionary.Add(new
FormKey
(kvp.Key.AsMemory()), kvp.Value);
Binding\PrefixResolverTests.cs (1)
195
return keys.Select(k => new
FormKey
(k.AsMemory()));
FormMapping\Converters\NullableConverterTests.cs (3)
87
{ new
FormKey
(prefixName.AsMemory()), (StringValues)string.Empty }
111
{ new
FormKey
(prefixName.AsMemory()), (StringValues)date.ToString(culture) }
134
{ new
FormKey
(prefixName.AsMemory()), (StringValues)"bad date" }
34 references to FormKey
Microsoft.AspNetCore.Components.Endpoints (27)
FormMapping\FormDataReader.cs (15)
17
private readonly IReadOnlyDictionary<
FormKey
, StringValues> _readOnlyMemoryKeys;
26
private IReadOnlyDictionary<
FormKey
, HashSet<
FormKey
>>? _formDictionaryKeysByPrefix;
30
public FormDataReader(IReadOnlyDictionary<
FormKey
, StringValues> formCollection, CultureInfo culture, Memory<char> buffer)
37
public FormDataReader(IReadOnlyDictionary<
FormKey
, StringValues> formCollection, CultureInfo culture, Memory<char> buffer, IFormFileCollection formFileCollection)
124
internal IReadOnlyDictionary<
FormKey
, HashSet<
FormKey
>> ProcessFormKeys()
127
var result = new Dictionary<
FormKey
, HashSet<
FormKey
>>();
135
foreach (
var
key in keys)
155
result.Add(new FormKey(prefix), new HashSet<
FormKey
> { new FormKey(keyValue) });
289
private readonly HashSet<
FormKey
> _values;
294
public FormKeyCollection(HashSet<
FormKey
> values) => _values = values;
304
private HashSet<
FormKey
>.Enumerator _enumerator;
306
public Enumerator(HashSet<
FormKey
>.Enumerator enumerator)
FormMapping\FormKey.cs (3)
9
internal readonly struct FormKey(ReadOnlyMemory<char> value) : IEquatable<
FormKey
>
15
public override readonly bool Equals(object? obj) => obj is
FormKey
prefix && Value.Equals(prefix.Value);
17
public readonly bool Equals(
FormKey
other) =>
FormMapping\HttpContextFormValueMapper.cs (1)
125
var dictionary = new Dictionary<
FormKey
, StringValues>();
FormMapping\PrefixResolver.cs (8)
10
private readonly
FormKey
[] _sortedKeys;
15
public PrefixResolver(IEnumerable<
FormKey
> readOnlyMemoryKeys, int count)
17
_sortedKeys = ArrayPool<
FormKey
>.Shared.Rent(count);
20
foreach (
var
key in readOnlyMemoryKeys)
41
ArrayPool<
FormKey
>.Shared.Return(_sortedKeys);
45
private class FormKeyComparer(bool checkPrefix) : IComparer<
FormKey
>
51
public int Compare(
FormKey
x,
FormKey
y)
Microsoft.AspNetCore.Components.Endpoints.Tests (7)
Binding\FormDataMapperTests.cs (1)
80
var dictionary = new Dictionary<
FormKey
, StringValues>(collection.Count);
Binding\PrefixResolverTests.cs (2)
25
var prefixResolver = new PrefixResolver(Array.Empty<
FormKey
>(), 1);
193
private static IEnumerable<
FormKey
> GetKeys(params string[] keys)
FormMapping\Converters\NullableConverterTests.cs (4)
65
var dictionary = new Dictionary<
FormKey
, StringValues>();
85
var dictionary = new Dictionary<
FormKey
, StringValues>()
109
var dictionary = new Dictionary<
FormKey
, StringValues>()
132
var dictionary = new Dictionary<
FormKey
, StringValues>()