Created
March 3, 2019 15:46
-
-
Save explorer14/61885adfa759858af3eee4bcbf9188a2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ValidationProblemDetails : ProblemDetails | |
{ | |
public ValidationProblemDetails() : base() | |
{ | |
} | |
public ValidationProblemDetails( | |
ModelStateDictionary modelStateDictionary) | |
: base() | |
{ | |
this.Errors = modelStateDictionary | |
.ToDictionary(x => x.Key, | |
y => y.Value.Errors.Select( | |
z => z.Exception.Details()).ToArray()); | |
} | |
[JsonProperty(PropertyName = "errors")] | |
public IDictionary<string, string[]> Errors { get; } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment