Skip to content

Instantly share code, notes, and snippets.

View chalisegrogan's full-sized avatar

Chalise Grogan chalisegrogan

  • California
  • 22:54 (UTC -08:00)
View GitHub Profile
if (!ModelState.IsValid)
{
var sb = new System.Text.StringBuilder();
Dictionary<string, IEnumerable<Exception>> errorList = ModelState.ToDictionary(
kvp => kvp.Key,
kvp => kvp.Value.Errors.Select(e => e.Exception)
);
sb.AppendLine("Exceptions:");