static void Main(string[] args) { //Ask for user input for game name Console.WriteLine("Enter game name:"); //Accept user input for game name string gameName = Console.ReadLine(); //Add StructureMap for DI var container = new StructureMap.Container(x => { x.For <LibraryInterfaces.IDeckOfCards>(). Use <CardGameLibrary.DeckOfCards>() .Singleton() .Ctor <string>("cardType"); }); var deckOfCards = container.With("cardType") .EqualTo(gameName) .GetInstance <LibraryInterfaces.IDeckOfCards>(); switch (gameName.ToUpper()) { case CardGameLibrary.Constants.BLACKJACK: PlayBlackJack(deckOfCards); break; case CardGameLibrary.Constants.HIGHCARD: PlayHighCard(deckOfCards); break; default: Console.WriteLine("Please enter a supported game name(BLACKJACK or HIGHCARD)."); break; } }