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

IConnectionStrings is enumerable and can be used in a foreach loop #11

Merged
merged 2 commits into from
Nov 26, 2015
Merged

IConnectionStrings is enumerable and can be used in a foreach loop #11

merged 2 commits into from
Nov 26, 2015

Conversation

sachpatel
Copy link
Contributor

Feature - Enumerable IConnectionStrings

What is it?

  • Found a need in a personal project to be able to collect/pick up on defined connectionstrings in the configuration without knowing the fully qualified identifier for the connection string key. Example is there could be a differing number of connection strings pointing to country databases but it is not known whilst coding which and how many databases the application will connect to.

Additonal Comments?

This is a great project, thank you for sharing. Being able to use configuration values without referencing the original baked in ConfigurationManager and be able to unit test without writing custom wrapper interfaces is a big relief across existing and new projects.

{
for (int pos = 0; pos < Raw.Count; pos++)
{
yield return Raw[pos];
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we change this to

yield return Intercept(Raw[pos]);

To keep consistency with the rest of the API in ConnectionStringsExtended.

@davidwhitney
Copy link
Owner

Generally - yep, like this - just need to ensure that enumerating has consistent interception before it's good to go 👍

@sachpatel
Copy link
Contributor Author

Thank you for the spot. Updated PR

davidwhitney added a commit that referenced this pull request Nov 26, 2015
IConnectionStrings is enumerable and can be used in a foreach loop
@davidwhitney davidwhitney merged commit 0c794ba into davidwhitney:master Nov 26, 2015
@davidwhitney
Copy link
Owner

Once this passes CI I'll publish it.

Thanks :)

@davidwhitney
Copy link
Owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants