Esempio n. 1
0
 public UriContextBase(UriSchemaBase schema, Uri uri)
 {
     if (schema == null)
         throw new ArgumentNullException("schema");
     if (uri == null)
         throw new ArgumentNullException("uri");
     Schema = schema;
     OriginalUri = uri;
     Path = (!uri.IsAbsoluteUri ? uri.OriginalString : uri.LocalPath);
 }
 public UriContextBase(UriSchemaBase schema, Uri uri)
 {
     if (schema == null)
     {
         throw new ArgumentNullException("schema");
     }
     if (uri == null)
     {
         throw new ArgumentNullException("uri");
     }
     Schema      = schema;
     OriginalUri = uri;
     Path        = (!uri.IsAbsoluteUri ? uri.OriginalString : uri.LocalPath);
 }
        public static UriContextBase ParseRequestUriWithUriSchema(this HttpContextBase 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);
        }