What is the analog request.Properties in ASP.NET 5

In WebApi2, it was customary to put arbitrary objects in HttRequestMessage.Properties. This was usually done using extension methods, such as request.SetUserRights()where SetUserRightsyou simply placed the object in request.Properties[HttpPropertyKey.UserRights].

Now in ASP.NET 5 there is no such property in HttpRequest.

What template is supposed to be used for transferring arbitrary objects together with an HTTP request?

In WebApi to place objects in a request. Commonly used filter filters. We still have filters in AspNet5, so the question can be rephrased as: where should the filter put the general data for the request. Examples of such data can be: current user roles, current user language, etc.

+4
source share
1 answer

HttpContexta class has a Itemsproperty that you can use for this purpose.

+7
source

All Articles