Created
January 15, 2012 05:51
-
-
Save Lobstrosity/1614591 to your computer and use it in GitHub Desktop.
Revisions
-
Lobstrosity revised this gist
Jan 15, 2012 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,7 @@ public class OurContext : DbContext { public string ClientKey { get; private set; } /// We make use of the DbContext constructor overload that accepts a /// connection string to connect to. -
Lobstrosity created this gist
Jan 15, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ public class OurContext : DbContext { /// We make use of the DbContext constructor overload that accepts a /// connection string to connect to. public OurContext(string clientKey) : base(GetClientConnectionString(clientKey)) { ClientKey = clientKey; } /// There's a static method in one of our base assemblies that returns a /// client's database connection string based on the client's short name. public static string GetClientConnectionString(string clientKey) { return AClassInOneOfOurBaseAssemblies.GetConnectionString(clientKey); } }