Hi Guys,
Still plugging away on OR building this API and its coming along nicely!
I have a best practices question just now, in the form of the resource the API will return.
I am looking to have a standardised response returned that can include errors and system messages, so i'm wondering if its best practice to but a base class on the resources with errors collection, or to do the following.
[XmlRoot(ElementName = "ApiResult")]
public class ApiResult<T> where T : class
{
public ApiResult() {}
public ApiResult(T resource)
{
Resource = resource;
}
public T Resource { get; set; }
public string[] Errors { get; set; }
}
I am not 100% sold on this being the best way to achieve what I am looking for, and considering OR has pretty much got everything else i'm wondering if I am approaching this scenario from the wrong direction.
David
--
"I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question." -- Charles Babbage