Example #1
0
        public static ObjectResult RespondSuccessTo(int statusCode, dynamic data)
        {
            ApiResponder apiResponder = new ApiResponder(data, null);

            var objectResult = new ObjectResult(apiResponder)
            {
                StatusCode = statusCode
            };

            return(objectResult);
        }
Example #2
0
        public static ObjectResult RespondFailureTo(int statusCode, dynamic errors, string errorCode)
        {
            ApiResponder apiResponder = new ApiResponder(null,
                                                         new Error {
                errorMessage = errors, errorCode = Convert.ToInt32(errorCode)
            });

            var objectResult = new ObjectResult(apiResponder)
            {
                StatusCode = statusCode
            };

            return(objectResult);
        }