public void ProcessRequest(HttpContext context) { //validate query parameters QueryParams queryParams; try { queryParams = new QueryParams(context.Request); } catch { context.Response.StatusCode = 400; //bad request return; } //convert query parameters to entities var ctx = new DiscCtx(ConfigManager.ConnStr); var reportParams = queryParams.Materialize(ctx); if (reportParams == null) { context.Response.StatusCode = 400; return; } //compute and set report parameters var report = new SourcesReport { ReportParams = reportParams, }; context.Response.Write(report.TransformText()); }