internal virtual void WriteResponse(DirectRequest directRequest, HttpResponseBase response)
        {
            var            method = DirectProvider.GetCurrent().GetMethod(directRequest.Action, directRequest.Method);
            DirectResponse directResponse;

            if (method.EventName != null)
            {
                directResponse = new DirectEventResponse(directRequest)
                {
                    Name     = method.EventName,
                    Data     = Data,
                    Settings = Settings
                };
            }
            else
            {
                directResponse = new DirectDataResponse(directRequest)
                {
                    Result   = Data,
                    Settings = Settings
                };
            }

            directResponse.Write(response, ContentType, ContentEncoding);
        }
        internal virtual void WriteResponse(DirectRequest directRequest, HttpResponseBase response) {
            var method = DirectProvider.GetCurrent().GetMethod(directRequest.Action, directRequest.Method);
            DirectResponse directResponse;

            if (method.EventName != null) {
                directResponse = new DirectEventResponse(directRequest) {
                    Name = method.EventName,
                    Data = Data,
                    Settings = Settings
                };
            } else {
                directResponse = new DirectDataResponse(directRequest) {
                    Result = Data,
                    Settings = Settings
                };
            }

            directResponse.Write(response, ContentType, ContentEncoding);
        }