Conversion to Lamar - Registration - What's the equivalent of this code that uses StructureMap?

117 Views Asked by At

I'm migrating an ASP.NET application to .NET5 and have come across the following code that uses StructureMap...

For<ICache>().AlwaysUnique().Singleton().HttpContextScoped().Add<RedisCache>()

We are using Lamar in the new application; what's the equivalent code to replace .AlwaysUnique().Singleton().HttpContextScoped()?

1

There are 1 best solutions below

0
inthegarden On

Having had some comms with Jeremy Miller (Lamar author) he has confirmed that the last one wins, in the this case it would be HttpContextScoped (or Scoped in Lamar).