private dynamic Handler(dynamic parameters) { IHttpContext httpContext = new NancyHttpContext(Context); // Creating a request handler factory for Active Query Builder HandlerFactory factory = new HandlerFactory(); // handling the request var handler = factory.CreateHandler(Context.Request.Path, httpContext); handler.ProcessRequest(); // returning the response return(Context.Response); }
public IndexModule() { Get["/"] = parameters => { // Custom context based on the NancyContext to define data interchange rules with the client part of Active Query Builder IHttpContext httpContext = new NancyHttpContext(Context); // Get an instance of the QueryBuilder object according to the SessionID from the context. if (QueryBuilderStore.Get(httpContext, InstanceId) == null) { CreateQueryBuilder(httpContext); } return(View["index"]); }; // handling queries from the Active Query Builder clients Get["/{ActiveQueryBuilder*}"] = Handler; Post["/{ActiveQueryBuilder*}"] = Handler; }