Skip to content

Instantly share code, notes, and snippets.

@brianium
Created March 13, 2014 18:23
Show Gist options
  • Save brianium/9533924 to your computer and use it in GitHub Desktop.
Save brianium/9533924 to your computer and use it in GitHub Desktop.
public class ConnectionFactory : IConnectionFactory
{
private static readonly IDictionary Strings = new Dictionary<string,string>();
static ConnectionFactory()
{
lock(Strings.SyncRoot)
{
Strings.Add("key", "value");
}
}
public SqlConnection GetConnection(string key)
{
//actually create connection
}
}
public interface IConnectionFactory
{
IDbConnection GetConnection(string key);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment