Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I want a way to have a specific dependency register in specific environments #4

Open
hartmannr76 opened this issue Mar 30, 2017 · 0 comments
Assignees
Milestone

Comments

@hartmannr76
Copy link
Owner

Microsoft.AspNetCore already has a concept of HostingEnvironment. Maybe we should take a wrapper that allows these types of configs to be setup to determine which dependency to actually register, based on the environment.

For example, if I were to be running this on a system that doesn't need to connect to a database, but in production I want it to, I'd expect to see the following:

[Dependency(Environment=Config.Staging)]
public class InMemoryRepository : IRepository {
 // does in-memory version of IRepository work
}

[Dependency(Environment=Config.Production)]
public class DatabaseRepository : IRepository {
 // does database version of IRepository work
}

We can default this to an Any this way ones that are not configured, register for all sets

@hartmannr76 hartmannr76 added this to the v2.0.0 milestone Mar 31, 2017
@hartmannr76 hartmannr76 self-assigned this Mar 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant