JaimeStill / decentralized-staffing

PoC for structuring microservice apps and automating their infrastructure in Azure
0 stars 0 forks source link

API Response Model #3

Closed JaimeStill closed 1 year ago

JaimeStill commented 1 year ago

Instead of directly returning results, results should be wrapped in an object that provides details about the status of the request. Primarily, this will handle scenarios where the request is invalid, but not an exception (i.e. - trying to save an entity fails validation).

Initial concept:

public record ApiResult<T>
{
    public string Message { get; set; }
    public T? Result { get; set; }
}