Exemplo n.º 1
0
        public IActionResult BusinessErrorResponse(List <BusinessErrorSM> errors)
        {
            var response = new ApiResponseAM
            {
                Success        = false,
                BusinessErrors = errors,
                Data           = null
            };

            return(CreateResponse(response));
        }
Exemplo n.º 2
0
        public IActionResult SuccessResponse(object data)
        {
            var response = new ApiResponseAM
            {
                Success        = true,
                BusinessErrors = null,
                Data           = data
            };

            return(CreateResponse(response));
        }
Exemplo n.º 3
0
        public IActionResult BusinessErrorResponse(string errorMessage)
        {
            var businessErrors = new List <BusinessErrorSM>();

            businessErrors.Add(new BusinessErrorSM(BusinessErrorCodes.Generic, errorMessage));

            var response = new ApiResponseAM
            {
                Success        = false,
                BusinessErrors = businessErrors,
                Data           = null
            };

            return(CreateResponse(response));
        }
Exemplo n.º 4
0
 private IActionResult CreateResponse(ApiResponseAM responseModel)
 {
     return(Ok(responseModel));
 }