dependency injection properties code example
Example 1: dependency injection
Class A Class B if A uses some methods of B then its a dependency injection
Example 2: dependency injection
public class CustomerService
{
CustomerBusinessLogic _customerBL;
public CustomerService()
{
_customerBL = new CustomerBusinessLogic(new CustomerDataAccess());
}
public string GetCustomerName(int id) {
return _customerBL.ProcessCustomerData(id);
}
}