We're migrating from StructureMap to Lamar but I could not find the "Lamar version" for passing arguments at runtime.
We have a class that requires a string argument (pseudo code):
public class MyRepository {
public MyRepository(string accountId) {}
}
… and a factory
public class MyRepoFactory(Container container) {
public MyRepository GetRepositoryForAccount(string accountId) =>
container
// With() is not available in Lamar?
.With("accountId").EqualTo(accountId)
.GetInstance<IMyRepository>();
}
In reality there are additional dependencies.
How can a say Lamar GetInstance()
for IMyRepository
and use value xy for constructor argument named accountId
?