In our domain application, we use a type called ServiceResponse<> to send data between the levels of our application - in particular, each is returned to all methods in the domain. At the moment, it encapsulates the data (if any) that was returned from the method, or any errors that it could generate.
So my question is this: is it acceptable to apply fields to this object that can be useful in other layers of the application? For example, is it a good form to add a Status or StatusCode field to it, which can be interpreted later by the service layer for use as an HTTP status code (with or without any display)?
source share