Interface IFeatureCollection
Represents a collection of features carried by an IncomingRequest or an OutgoingRequest. It is similar but not identical to the IFeatureCollection provided by ASP.NET Core for HTTP features.
public interface IFeatureCollection : IEnumerable<KeyValuePair<Type, object>>, IEnumerable
- Inherited Members
- Extension Methods
Properties
IsReadOnly
Gets a value indicating whether this feature collection is read-only or read-write.
bool IsReadOnly { get; }
Property Value
this[Type]
Gets or sets a feature. Setting null removes the feature.
object? this[Type key] { get; set; }
Parameters
key
TypeThe feature key.
Property Value
- object
The requested feature.
Methods
Get<TFeature>()
Gets the requested feature. If the feature is not set, returns null.
TFeature? Get<TFeature>()
Returns
- TFeature
The requested feature.
Type Parameters
TFeature
The feature key.
Set<TFeature>(TFeature?)
Sets a new feature. Setting null removes the feature.
void Set<TFeature>(TFeature? feature)
Parameters
feature
TFeatureThe feature value.
Type Parameters
TFeature
The feature key.