public class StoreDetails
{
public int StoreId { get; set; }
}
I want to create an instance of StoreDetails for per request to Web API. This instance will be used as dependency for various other classes in project.
Also I want to set value of "StoreId" property to HttpContext.Current.Request.Headers["StoreId"]
I am using Unity as container with help of following libraries: Unity 3.5.1404.0 Unity.AspNet.WebApi 3.5.1404.0
I have following method to register types
public static void RegisterTypes(IUnityContainer container)
{
container.RegisterInstance<StoreDetails>(/* how to provide some method to inject required StoreId from HttpContext.Current.Request.Headers["StoreId"] per request */);
}