Last active
January 20, 2016 18:45
-
-
Save JoseGonzalez321/880047ba224fe45ce407 to your computer and use it in GitHub Desktop.
Gist for blog post: http://www.mindbodysouldeveloper.com/2016/01/27/c-sharp-how-to-replace-dictionary-with-factory-method/
This file contains 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 characters
private static Dictionary<string, object> SetupStoredProcParameters(Level level, | |
DateTime valueDate, | |
string branch, | |
string levelName, | |
string subLevelName) | |
{ | |
var parameters = new Dictionary<string, object>(); | |
switch(level) | |
{ | |
case Level.Top: | |
parameters.Add(StoredProcParam.ValueDate, valueDate); | |
parameters.Add(StoredProcParam.Branch, branch); | |
break; | |
case Level.One: | |
parameters.Add(StoredProcParam.ValueDate, valueDate); | |
parameters.Add(StoredProcParam.Branch, branch); | |
parameters.Add(StoredProcParam.LevelName, levelName); | |
break; | |
case Level.Two: | |
parameters.Add(StoredProcParam.ValueDate, valueDate); | |
parameters.Add(StoredProcParam.Branch, branch); | |
parameters.Add(StoredProcParam.LevelName, levelName); | |
parameters.Add(StoredProcParam.SubLevelName, subLevelName); | |
break; | |
default: | |
break; | |
} | |
return parameters; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment