public void AddUserContext(HttpContext httpContext, User user) { var userContext = new UserContext(user); httpContext.Items.Add("UserContext", userContext); }
public void AddMessageHeaders(IMessageContext messageContext, IDictionaryIn this example, we're adding a MessageHeaders object to the message context using the SetContext method. The MessageHeaders object holds the message headers. The package library for this example would depend on the messaging system being used. For example, if you're using the NServiceBus messaging framework, the NServiceBus.Core package provides the IMessageContext interface.headers) { var messageHeaders = new MessageHeaders(headers); messageContext.SetContext(messageHeaders); }