Table of Contents

Interface IErrorMappingFactory

Namespace
MRX.UI.ErrorsAutoWiring.Abstractions
Assembly
MRX.UI.ErrorsAutoWiring.dll

Maps coded errors returned by an HTTP response to the fields of the model bound to an EditContext.

public interface IErrorMappingFactory

Methods

CreateErrorFieldMap(EditContext, Dictionary<string, CodedError[]>, HttpResponseMessage)

Builds a map of field identifiers to their associated coded errors.

Dictionary<FieldIdentifier, List<CodedError>> CreateErrorFieldMap(EditContext editContext, Dictionary<string, CodedError[]> errors, HttpResponseMessage response)

Parameters

editContext EditContext

The edit context whose model the errors should be mapped against.

errors Dictionary<string, CodedError[]>

The coded errors, keyed by the server-provided error key.

response HttpResponseMessage

The HTTP response the errors were extracted from.

Returns

Dictionary<FieldIdentifier, List<CodedError>>

A dictionary linking each resolved field identifier to the list of errors that apply to it.