예제 #1
0
        public override string GetStringValue(HttpRouteBase route, RouteContext routeContext)
        {
            if (routeContext.HttpRequest.Headers.ContainsHeader(this.HeaderName))
            {
                return(routeContext.HttpRequest.Headers[this.HeaderName]);
            }

            return(null);
        }
예제 #2
0
 public DataBindingException(
     Exception innerException,
     HttpRouteBase route,
     RouteContext routeContext,
     RouteDataBindingBaseAttribute routeDataBindingBaseAttribute,
     PropertyInfo propertyInfo)
     : base("Exception occurred during data binding. Check inner exception for details", innerException)
 {
     this.Route        = route;
     this.RouteContext = routeContext;
     this.RouteDataBindingBaseAttribute = routeDataBindingBaseAttribute;
     this.PropertyInfo = propertyInfo;
 }
 /// <summary>
 /// Perform the data binding logic and return the bindable value.
 /// This value will be attached to the decorated property.
 /// The value can be
 /// </summary>
 /// <param name="module"><see cref="HttpRouteBase"/> object.</param>
 /// <param name="routeContext"><see cref="RouteContext"/> for the current request.</param>
 /// <param name="propertyType"><see cref="Type"/> of property to be binded.</param>
 /// <returns>Object to be binded to the decorated property.</returns>
 public abstract object DataBind(HttpRouteBase route, RouteContext routeContext, Type propertyType);
예제 #4
0
 public override string GetStringValue(HttpRouteBase route, RouteContext routeContext)
 {
     return(routeContext.HttpRequest.BodyString);
 }