public static UriContextBase ParseRequestUriWithUriSchema(this HttpContext httpContext, UriSchemaBase uriSchema) { if (httpContext == null) { throw new ArgumentNullException("httpContext"); } if (uriSchema == null) { throw new ArgumentNullException("uriSchema"); } var uriContext = uriSchema.ParseUri(httpContext.Request); httpContext.Set <UriContextBase>(uriContext); return(uriContext); }