private static string GetMessage(ModelStateDictionary dictionary) { return(dictionary.Aggregate( "The following stuff is wrong:", (current, kvp) => current + (Environment.NewLine + $"{kvp.Key}: {string.Join(", ", kvp.Value.Errors.Select(error => error.ErrorMessage))}"))); }