public CustomerBll(ICustomerDal theCustomerDal) { customerDal = theCustomerDal; }
public void Add(ICustomerDal customerDal) { customerDal.Add(); }
public HomeController(ICustomerDal customerDal, IUserDal userDal) { _customerDal = customerDal; _userDal = userDal; }
public RentalManager(IRentalDal rentalDal, ICustomerDal customerDal, ICarDal carDal) { _rentalDal = rentalDal; _customerDal = customerDal; _carDal = carDal; }
public GetCorpAduitConfigServiceBll(ICorpAduitConfigDal corpAduitConfigDal, ICorpAduitConfigDetailDal corpAduitConfigDetailDal, ICustomerDal customerDal) { _corpAduitConfigDal = corpAduitConfigDal; _corpAduitConfigDetailDal = corpAduitConfigDetailDal; _customerDal = customerDal; }
public CustomerController(ICustomerDal customerDal) : base(customerDal) { }
public CustomerManager(ICustomerDal customerDal, IUserService userService) { _customerDal = customerDal; _userService = userService; }
public CustomerManager(ICustomerDal ıCustomerDal) { _ICustomerDal = ıCustomerDal; }
//Burada direk sql yada oracle'ı kullansaydık sadece o veri tabanına bağımlıyız. //Yani yeni bir müşteri veritabanım oracle dese biz sadece sql server destekliyoruz demek zorunda kaldırdık. public void Add(ICustomerDal customerDal) //Daha ileride consructordan alacağız. Dependency injection yapacağız. { //Böyle yaparsak sql server gönderirse onun içerisinde add çalışır. //Oracle gönderirse onun içerisinde add methodu çalışır. Ikisinide desteklemiş oluruz. customerDal.Add(); //Burada ne sql ne oracle görüyoruz tamamen interface üzerinden gidiyor. }
public void Add(ICustomerDal customerDal) // burada ADD oracle 'a göre mi yoksa SQL e göre mi yapılacak :?? biriyle yazılırsa diğerini kullanamayacağız... //ancak parantez içi interface bizi kurtaracaktır.. orada ne SQL ne de Oracle olacak, hangisi verilirse o uygulanacak .... { }
public CustomerService(ICustomerDal customerDal) { _customerDal = customerDal; }
public CustomerManager(ICustomerDal customer) { _customers = customer; }
public CustomerManager(ICustomerDal customerService) { _customerDal = customerService; }
public UserManager(IUserDal userDal, ICustomerDal customerDal) { _userDal = userDal; _customerDal = customerDal; }
public void Update(ICustomerDal customerDal) { customerDal.Update(); }
public CustomerManager(ICustomerDal costumerDal) { _costumerDal = costumerDal; }
public GetCorpBookingDepartListServiceBll(IGetCorpDepartmentBll getCorpDepartmentBll, ICustomerDal customerDal, ICustomerUnionDal customerUnionDal) { _getCorpDepartmentBll = getCorpDepartmentBll; _customerDal = customerDal; _customerUnionDal = customerUnionDal; }
public GetCostCenterServiceBll(ICostCenterDal centerDal, ICustomerDal customerDal) : base() { _centerDal = centerDal; _customerDal = customerDal; }
public void Add(ICustomerDal dal) { dal.Add(); }
public CustomerManager(ICustomerDal customer) { this.customer = customer; }
static void Main(string[] args) { Customer customer = new Customer(); customer.Id = 0; customer.FirstName = "Kerem"; customer.LastName = "Yılmaz"; customer.Address = "İstanbul"; Student student = new Student(); student.Id = 0; student.FirstName = "Hatice"; student.LastName = "Ateş"; student.Department = "Computer Science"; Worker worker = new Worker(); worker.Id = 0; worker.FirstName = "Beren"; worker.LastName = "Çalışer"; worker.Department = "IT"; IPerson person1 = new Customer(); person1.Id = 0; person1.FirstName = "Ceren"; person1.LastName = "Çalışkan"; //IPerson person = new IPerson(); // Cannot create an instance of the abstract type or interface. // Interfaceler newlenemez, içi boş soyut bir sınıftır. Anlamsız. PersonManager personManager = new PersonManager(); personManager.Add(new Student() { Id = 0, FirstName = "İrem", LastName = "Çalışkan", Department = "Computer Engineering" }); personManager.Add(customer); personManager.Add(student); personManager.Add(worker); CustomerManager customerManager = new CustomerManager(); customerManager.Add(new SqlServerCustomerDal()); customerManager.Add(new OracleCustomerDal()); // Uygulamanın bağımlılıklarını minimize etmek amacımız! // Polymorphism : çok biçimlilik, bir nesneyi farklı amaçlarla implemente edip, o implementasyonlara ulaşmak. // ICustomerDal bir çok biçimlilik örneğidir. // Her iki veritabanınında kullanılması istenirse. // MySql'de istenirse: ICustomerDal[] customerDals = new ICustomerDal[] { new SqlServerCustomerDal(), new OracleCustomerDal(), new MySqlCustomerDal() }; foreach (var customerDal in customerDals) { customerDal.Add(); // Herbiri için Add çağırıldı. } for (int i = 0; i < customerDals.Length; i++) { customerDals[i].Add(); } }
public void Add(ICustomerDal customerDal) { customerDal.Add(); customerDal.Delete(); customerDal.Update(); }
public CustomerManager(ICustomerDal ıcustomerdal) { _ıcustomerDal = ıcustomerdal; }
public CustomerManager(ICustomerDal dal) { _dal = dal; }
public CustomerManager(ICustomerDal customerDal) { _customerService = customerDal; }
public CustomersLogic(ICustomerDal customersDal, IOptions <AppSettings> appSettings) { _customersDal = customersDal; _appSettings = appSettings.Value; }
public void Add(ICustomerDal customerDal) //mesela bir proje yaptık. Sql'e göre. sonra müşteri geldi, benim veritabanım Oracle'ye göre. bunun için : { customerDal.Add(); //Burada ne Sql görüyoruz ne ORacle. sadece interfaceyi görüyoruz. Gittik buradan program.cs nin içerisine. }
public void Delete(ICustomerDal customerDal) { customerDal.Delete(); }
public CustomerManager(ICustomerDal customerDal) { _customerDal = customerDal; }
public CustomerManager(IStarbucksService starbucks, IPortalService portal, ICompanyService company, ICustomerDal customer) { _portal = portal; _starbucks = starbucks; _company = company; _customer = customer; }