예제 #1
0
        public ViewResponse(HttpResponceCode statusCode, IView view)
        {
            this.ValidateStatusCode(statusCode);

            this.view       = view;
            this.StatusCode = statusCode;
        }
예제 #2
0
        private void ValidateStatusCode(HttpResponceCode statusCode)
        {
            var statusCodeNumber = (int)statusCode;

            if (statusCodeNumber > 300 && statusCodeNumber < 399)
            {
                throw new InvalidResponseException("Invalid status code for correct response.");
            }
        }