static void Main(string[] args) { string connectionString; connectionString = ConfigurationManager.ConnectionStrings["AddressBook"].ConnectionString; string contactsFileName = ConfigurationManager.AppSettings["ContactsDatabaseFileName"]; string name = ConfigurationManager.AppSettings["ApplicationName"]; Console.WriteLine("WELCOME TO:"); Console.WriteLine(name); Console.WriteLine(new string('-', Console.WindowWidth - 4)); Console.WriteLine(); Console.WriteLine("Press Enter to continue."); Console.ReadLine(); ContactsRepository contactsRepro = new ContactsRepository(contactsFileName); RecipesRepository recipesRepro = new RecipesRepository(connectionString); ConsoleReader consoleReader = new ConsoleReader(); Rolodex rolodex = new Rolodex(contactsRepro, recipesRepro, consoleReader); rolodex.DoStuff(); }
public Rolodex(string connectionString, string contactsFileName) { _contactsRepository = new ContactsRepository(contactsFileName); _recipesRepository = new RecipesRepository(connectionString); _contacts = new List <Contact>(); _recipes = new Dictionary <RecipeType, List <Recipe> >(); _recipes.Add(RecipeType.Appetizers, new List <Recipe>()); _recipes[RecipeType.Entreés] = new List <Recipe>(); _recipes.Add(RecipeType.Desserts, new List <Recipe>()); }