1 instantiation of FormMappingError
Microsoft.AspNetCore.Components.Web (1)
Forms\Mapping\FormMappingContext.cs (1)
105
mappingError = new
FormMappingError
(key, new List<FormattableString>() { error }, attemptedValue);
24 references to FormMappingError
Microsoft.AspNetCore.Components.Web (24)
Forms\Mapping\EditContextFormMappingExtensions.cs (1)
61
foreach (
var
error in _mappingContext.GetAllErrors())
Forms\Mapping\FormMappingContext.cs (22)
13
private Dictionary<string,
FormMappingError
>? _errors;
14
private List<KeyValuePair<string,
FormMappingError
>>? _pendingErrors;
15
private Dictionary<string, Dictionary<string,
FormMappingError
>>? _errorsByFormName;
33
public
FormMappingError
? GetErrors(string key) =>
34
_errors?.TryGetValue(key, out
var
mappingError) == true ? mappingError : null;
42
public
FormMappingError
? GetErrors(string formName, string key) =>
44
formErrors.TryGetValue(key, out
var
mappingError) == true ? mappingError : null;
50
public IEnumerable<
FormMappingError
> GetAllErrors()
55
private static IEnumerable<
FormMappingError
> GetAllErrorsCore(Dictionary<string,
FormMappingError
>? errors)
59
return Array.Empty<
FormMappingError
>();
70
public IEnumerable<
FormMappingError
> GetAllErrors(string formName)
74
Array.Empty<
FormMappingError
>();
83
_errors?.TryGetValue(key, out
var
mappingError) == true ? mappingError.AttemptedValue : null;
93
formErrors.TryGetValue(key, out
var
mappingError) ? mappingError.AttemptedValue : null;
97
_errors ??= new Dictionary<string,
FormMappingError
>();
101
private static void AddErrorCore(Dictionary<string,
FormMappingError
> errors, string key, FormattableString error, string? attemptedValue, ref List<KeyValuePair<string,
FormMappingError
>>? pendingErrors)
103
if (!errors.TryGetValue(key, out
var
mappingError))
108
pendingErrors.Add(new KeyValuePair<string,
FormMappingError
>(key, mappingError));
118
_errorsByFormName ??= new Dictionary<string, Dictionary<string,
FormMappingError
>>();
121
formErrors = new Dictionary<string,
FormMappingError
>();
Forms\Mapping\FormMappingError.cs (1)
15
/// Initializes a new instance of <see cref="
FormMappingError
"/>.