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

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

            return(CreateResponse(response));
        }
Exemple #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));
        }
Exemple #4
0
 private IActionResult CreateResponse(ApiResponseAM responseModel)
 {
     return(Ok(responseModel));
 }