Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
static void Main(string[] args)
{
List<string> accNames = new List<string> { "B1-456", "B1-987", "B2-222" };
for (int i = 0; i < accNames.Count; i++)
{
AccountTypeFactory anAbstractFactory = AccountFactoryProvider.GetAccountTypeFactory(accNames[i]);
if (anAbstractFactory == null)
{
Console.WriteLine("Invalid " + (accNames[i]));
}
else
{
ISavingAccount savingAccount = anAbstractFactory.SavingAccountFactory("Hello saving");
ICurrentAccount currentAccount = anAbstractFactory.CurrentAccountFactory("Hello Current");
}
}
Console.ReadLine();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment