i am trying to inject a string into structuremap registry at run time. i have successfully done it with a static string. like this
For<TestDAL>().Use<TestDAL>().Ctor<string>("connectionString").Is("randomStringData");
but when i am trying to make the string dynamic at runtime i am not able to figure out how to send it, i have tried HttpContext and Session but they are always empty like the example below:
HttpContext.Current.GetOwinContext().Environment.TryGetValue("dynamicString", out object dynString);
For<TestDAL>().Use<TestDAL>().Ctor<string>("connectionString").Is(dynString);
Please anyone has anyidea on how to do this?