Exposes an ASP.NET Core request to the transaction policy expressions (see OpenTransactionExpressionModel.Request and CloseTransactionExpressionModel.Request).
The type attribute of the policy element must be set to AspNetCoreRequest to match requests of this class.
Implements
Namespace: PostSharp.Patterns.Diagnostics.Adapters.AspNetCore
Assembly: PostSharp.Patterns.Diagnostics.Adapters.AspNetCore.dll
Syntax
public readonly struct AspNetCoreRequestExpressionModel : IFormattableRemarks
Requests are captured only after Initialize(ICorrelationProtocol, Predicate<HttpRequest>, LogEventMetadata) has been called. In a policy expression, access
the request through the t.Request parameter, for example t.Request.Path.StartsWith("/invoices").
Properties
| Name | Description |
|---|---|
| Context | Gets the full HttpContext object. |
| Method | Gets the HTTP method, such as |
| Path | Gets the path of the URL, starting with a |
| Protocol | Gets the request protocol, such as |
| QueryString | Gets the query string starting with a |
| RemoteIpAddress | Gets the IP address of the remote client. |
| Scheme | Gets the request scheme, for instance |
| User | Gets the name of the current authenticated user, or |
Methods
| Name | Description |
|---|---|
| GetHeader(string) | Gets a specified header, or |