private static void Demo() { SqlServerCustomerDal sqlServerCustomerDal = new SqlServerCustomerDal(); OracleCustomerDal oracleServerCustomerDal = new OracleCustomerDal(); CustomerManager customerManager = new CustomerManager(); customerManager.Add(sqlServerCustomerDal); customerManager.Delete(oracleServerCustomerDal); customerManager.Update(sqlServerCustomerDal); }
static void Main(string[] args) { InterfaceIntro(); // Interface ve abstract lar new lenemez. //IPerson person = new IPerson(); diyemeyiz. //IPerson person = new Customer(); //diyebiliriz. ICustomerDal customerDal = new SqlServerCustomerDal(); customerDal.Add(); ICustomerDal customerDal1 = new OracleCustomerDal(); customerDal1.Add(); }
static void Main(string[] args) { //InterfacesIntro(); //Demo(); ICustomerDal[] customerDals = new ICustomerDal[3]; customerDals[0] = new SqlServerCustomerDal(); customerDals[1] = new OracleCustomerDal(); customerDals[2] = new MySqlCustomerDal(); foreach (var customerDal in customerDals) { customerDal.Add(); } Console.ReadLine(); }
static void Main(string[] args) { // InterfacesIntro(); //Demo(); SqlServerCustomerDal sqlServerCustomerDal = new SqlServerCustomerDal(); OracleCustomerDal oracleCustomerDal = new OracleCustomerDal(); MySqlCustomerDal mySqlCustomerDal = new MySqlCustomerDal(); ICustomerDal[] customerDals = new ICustomerDal[3] { sqlServerCustomerDal, oracleCustomerDal, mySqlCustomerDal }; foreach (var customerDal in customerDals) { customerDal.Add(); //Sql Added. Oracle Added. MySql Added. } }