using System.Collections.Generic;
public class ProblemDetailsValidation
public string Details { get; set; }
public Dictionary<string, string[]> Errors { get; set; }
public static void Main()
var errors = new Dictionary<string, string[]>()
{ "SupplierId", new [] { "'Supplier Id' must be 24 characters in length. You entered 26 characters.", "'Supplier Id' is not in the correct format." } }
var details = default(string);
var response = new ProblemDetailsValidation()
if (string.IsNullOrWhiteSpace(response?.Details))
Console.WriteLine(response.Details);
var errorMessage = string.Join(Environment.NewLine, response.Errors.Select(error => $"'{error.Key}': {Parse(error.Value)}"));
Console.WriteLine(errorMessage);
public static string Parse(string[] errors)
return string.Join(",", errors);