mardi 25 août 2015

Instantiating the class but declared as an interface

Lets just say i have this interface and repository

Interface :

interface ICustomerRepository
    {

Repository that implements the interface

public class CustomerRepository:ICustomerRepository
    {      

In controller, i declared an instance of the interface,

private ICustomerRepository repository = null;

can someone explain the concept of this line?

this.repository = new CustomerRepository();

Still learning here, need inputs

Aucun commentaire:

Enregistrer un commentaire