3 writes to _currentPrefixBuffer
Microsoft.AspNetCore.Components.Endpoints (3)
FormMapping\FormDataReader.cs (3)
209
_currentPrefixBuffer
= _currentPrefixBuffer[..^keyLength];
213
_currentPrefixBuffer
= _currentPrefixBuffer[..^(keyLength + 1)];
240
_currentPrefixBuffer
= _prefixBuffer.Slice(0, startingPoint + key.Length);
26 references to _currentPrefixBuffer
Microsoft.AspNetCore.Components.Endpoints (26)
FormMapping\FormDataReader.cs (26)
43
internal ReadOnlyMemory<char> CurrentPrefix =>
_currentPrefixBuffer
;
63
throw new FormDataMappingException(new FormDataMappingError(
_currentPrefixBuffer
.ToString(), errorMessage, attemptedValue));
70
_currentPrefixBuffer
.ToString(),
80
ErrorHandler.Invoke(
_currentPrefixBuffer
.ToString(), errorMessage, attemptedValue);
105
AttachInstanceToErrorsHandler(
_currentPrefixBuffer
.ToString(), value);
115
if (_formDictionaryKeysByPrefix.TryGetValue(new FormKey(
_currentPrefixBuffer
), out var foundKeys))
186
return _prefixResolver.HasPrefix(
_currentPrefixBuffer
);
206
Debug.Assert(
_currentPrefixBuffer
.Length >= keyLength);
207
if (
_currentPrefixBuffer
.Length == keyLength ||
_currentPrefixBuffer
.Span[^(keyLength + 1)] != '.')
209
_currentPrefixBuffer =
_currentPrefixBuffer
[..^keyLength];
213
_currentPrefixBuffer =
_currentPrefixBuffer
[..^(keyLength + 1)];
227
var separator =
_currentPrefixBuffer
.Length > 0 && key[0] != '['
232
throw new InvalidOperationException($"The maximum recursion depth of '{MaxRecursionDepth}' was exceeded for '{
_currentPrefixBuffer
}{separator}{key}'.");
235
Debug.Assert(_prefixBuffer.Length >= (
_currentPrefixBuffer
.Length + separator.Length));
237
separator.CopyTo(_prefixBuffer.Span[
_currentPrefixBuffer
.Length..]);
239
var startingPoint =
_currentPrefixBuffer
.Length + separator.Length;
246
var foundSingleValue = _readOnlyMemoryKeys.TryGetValue(new FormKey(
_currentPrefixBuffer
), out var result) || result.Count == 1;
260
_readOnlyMemoryKeys.TryGetValue(new FormKey(
_currentPrefixBuffer
), out values);
262
internal string GetPrefix() =>
_currentPrefixBuffer
.ToString();
266
var index =
_currentPrefixBuffer
.Span.LastIndexOfAny(".[");
269
return
_currentPrefixBuffer
.ToString();
271
if (
_currentPrefixBuffer
.Span[index] == '.')
273
return
_currentPrefixBuffer
.Span[(index + 1)..].ToString();
278
return
_currentPrefixBuffer
.Span[(index + 1)..^1].ToString();
324
$"Key count = {_readOnlyMemoryKeys.Count}, Prefix = {
_currentPrefixBuffer
}, Error count = {_errorCount}, Current depth = {_currentDepth}";