Skip to content

Instantly share code, notes, and snippets.

@pedrovasconcellos
Last active October 31, 2018 22:00
Show Gist options
  • Save pedrovasconcellos/fcb37df04e93389c76581c70717b0b71 to your computer and use it in GitHub Desktop.
Save pedrovasconcellos/fcb37df04e93389c76581c70717b0b71 to your computer and use it in GitHub Desktop.
Error details
//using System.Collections.Generic;
public class ErrorDetails
{
public ErrorDetails(Dictionary<string, string[]> errorsDictionary, string instance)
{
this.Errors = errorsDictionary;
this.Type = "Business Rules";
this.Title = "One or more validation errors occurred.";
this.Status = 422;
this.Detail = "Please refer to the errors property for additional details.";
this.Instance = instance;
}
public ErrorDetails(Dictionary<string, string[]> errorsDictionary, string instance, short status)
{
this.Errors = errorsDictionary;
this.Type = "Business Rules";
this.Title = "One or more validation errors occurred.";
this.Status = status;
this.Detail = "Please refer to the errors property for additional details.";
this.Instance = instance;
}
public Dictionary<string, string[]> Errors { get; set; }
public string Type { get; set; }
public string Title { get; set; }
public short Status { get; set; }
public string Detail { get; set; }
public string Instance { get; set; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment