Skip to content

Class AshxRouteData ​

Namespace: Tool.Web.Routing
Assembly: Tool.Net.dll

封装有关路由的信息。

csharp
public class AshxRouteData

Inheritance ​

object ← AshxRouteData

Inherited Members ​

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

Extension Methods ​

ObjectExtension.Add<T>(object, object, object), ObjectExtension.CopyEntity(object, object, params string[]), ObjectExtension.EntityToJson(object), ObjectExtension.EntityToJson(object, bool), ObjectExtension.EntityToJson(object, bool, string), DictionaryExtension.GetDictionary(object), TypeExtension.GetFieldKey(object, string, out bool), TypeExtension.GetFieldKey<T>(object, string, out bool), TypeExtension.GetFieldKey(object, Type, string, out bool), ObjectExtension.GetIntPtr(object), ObjectExtension.GetIntPtrInt(object), TypeExtension.GetPropertieFind(object, string, bool), TypeExtension.GetProperties(object), TypeExtension.GetPropertyKey(object, string, out bool), TypeExtension.GetPropertyKey<T>(object, string, out bool), TypeExtension.GetPropertyKey(object, Type, string, out bool), TypeExtension.GetValue(object, PropertyDescriptor), TypeExtension.GetValue(object, string, bool), TypeExtension.GetValue(object, string), ObjectExtension.Read<T>(object, object, int, int), ObjectExtension.Read<T>(object, int, object, int, int), DictionaryExtension.SetDictionary(object, IDictionary<string, object>), TypeExtension.SetFieldKey(object, string, object), TypeExtension.SetFieldKey<T>(object, string, object), TypeExtension.SetFieldKey(object, Type, string, object), TypeExtension.SetPropertyKey(object, string, object), TypeExtension.SetPropertyKey<T>(object, string, object), TypeExtension.SetPropertyKey(object, Type, string, object), TypeExtension.SetValue(object, PropertyDescriptor, object), TypeExtension.SetValue(object, string, object, bool), TypeExtension.SetValue(object, string, object), ObjectExtension.ToBase64String(object), ObjectExtension.ToBytes(object), ObjectExtension.ToBytes(object, out Type), DictionaryExtension.ToDictionary(object), DictionaryExtension.ToDictionary<T>(object), DictionaryExtension.ToIDictionary(object), DictionaryExtension.ToIDictionary<T>(object), ObjectExtension.ToJson(object), ObjectExtension.ToJson(object, JsonSerializerOptions), ObjectExtension.ToJsonWeb(object), ObjectExtension.ToJsonWeb(object, Action<JsonSerializerOptions>), ObjectExtension.ToTryVar<T>(object, T), ObjectExtension.ToVar<T>(object), ObjectExtension.ToVar(object, Type, bool), ObjectExtension.ToVar(object, string), ObjectExtension.ToXml(object)

Remarks ​

代码由逆血提供支持

Constructors ​

AshxRouteData(RouteContext, JsonSerializerOptions, ILogger, bool) ​

使用指定路由和路由处理程序初始化 类的新实例。

csharp
public AshxRouteData(RouteContext routeContext, JsonSerializerOptions jsonOptions, ILogger Logger, bool IsAsync)

Parameters ​

routeContext RouteContext

封装与所定义路由匹配的 HTTP 请求的相关信息。

jsonOptions JsonSerializerOptions

json配置对象

Logger ILogger

日志模块

IsAsync bool

Properties ​

Action ​

当前的方法名

csharp
public string Action { get; }

Property Value ​

string

Area ​

当前的控制器的命名空间

csharp
public string Area { get; }

Property Value ​

string

Controller ​

当前的控制器

csharp
public string Controller { get; }

Property Value ​

string

DataTokens ​

获取在 ASP.NET 路由确定路由是否匹配请求时,传递到路由处理程序但未使用的自定义值的集合。

csharp
public RouteValueDictionary DataTokens { get; }

Property Value ​

RouteValueDictionary

GetAshx ​

获取当前对象的 Ashx

csharp
public Ashx GetAshx { get; }

Property Value ​

Ashx

GetRouteData ​

获取有关所请求路由的信息。

csharp
public virtual RouteData GetRouteData { get; }

Property Value ​

RouteData

Handler ​

获取或设置处理所请求路由的对象。

csharp
public RequestDelegate Handler { get; set; }

Property Value ​

RequestDelegate

HttpContext ​

获取有关 HTTP 请求的信息。

csharp
public virtual HttpContext HttpContext { get; }

Property Value ​

HttpContext

IsAshx ​

获取当前对象的 Ashx 是否为空

csharp
public bool IsAshx { get; }

Property Value ​

bool

IsAsync ​

是否采用异步线程池,处理每次请求路由的过程

csharp
public virtual bool IsAsync { get; }

Property Value ​

bool

Key ​

每次请求生成的Id

csharp
public string Key { get; }

Property Value ​

string

Logger ​

日志信息

csharp
public virtual ILogger Logger { get; }

Property Value ​

ILogger

Routers ​

获取或设置表示路由的对象。

csharp
public IList<IRouter> Routers { get; }

Property Value ​

IList<IRouter>

Service ​

获取有关所请求路由的信息。

csharp
public virtual IServiceProvider Service { get; }

Property Value ​

IServiceProvider

Values ​

获取路由的 URL 参数值和默认值的集合。

csharp
public RouteValueDictionary Values { get; }

Property Value ​

RouteValueDictionary

Methods ​

GetNewJsonOptions() ​

获取一个新的 JsonSerializerOptions 对象 原对象来源于 AddAshx 时注册值

csharp
public JsonSerializerOptions GetNewJsonOptions()

Returns ​

JsonSerializerOptions

新的 JsonSerializerOptions 对象

GetRequired(string) ​

使用指定标识符检索值。

csharp
public object GetRequired(string valueName)

Parameters ​

valueName string

要检索的值的键。

Returns ​

object

其键与 valueName 匹配的 System.Web.Routing.RouteData.Values 属性中的元素。

Exceptions ​

InvalidOperationException

valueName 的值不存在。

GetRequiredString(string) ​

使用指定标识符检索值。

csharp
public string GetRequiredString(string valueName)

Parameters ​

valueName string

要检索的值的键。

Returns ​

string

其键与 valueName 匹配的 System.Web.Routing.RouteData.Values 属性中的元素。

Exceptions ​

InvalidOperationException

valueName 的值不存在。

基于Apache-2.0协议开源