static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Libraries libraries = new Libraries(); TitlesDBRepository repoTitles = new TitlesDBRepository("DESKTOP-E94DLUN\\SQLEXPRESS", "Libraries"); CharactersDBRepository repoCharacters = new CharactersDBRepository("DESKTOP-E94DLUN\\SQLEXPRESS", "Libraries"); OneToManyService <int, Title, int, Character> service = new OneToManyService <int, Title, int, Character>(repoTitles, repoCharacters, new CharacterValidator()); libraries.MyService = service; Console.WriteLine("bla"); Application.Run(libraries); }
static void Main() { string database = ConfigurationManager.AppSettings.Get("database"); string server = ConfigurationManager.AppSettings.Get("server"); string parentTable = ConfigurationManager.AppSettings.Get("parentTable"); string childTable = ConfigurationManager.AppSettings.Get("childTable"); string parentPrimaryKey = ConfigurationManager.AppSettings.Get("parentPrimaryKey"); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Libraries libraries = new Libraries(parentTable, childTable); DBRepository parentRepo = new DBRepository(server, database, parentTable); DBRepository childRepo = new DBRepository(server, database, childTable); OneToManyService service = new OneToManyService(parentRepo, childRepo, parentPrimaryKey); libraries.MyService = service; Application.Run(libraries); }