Im new in design pattern and c#,i know using interface means any class inherit the interface forces to implement the method signature,in the repository pattern i see,for example we should create a IStudent repository first,like :
public interface IStudents
{
IEnumerable<students> getAll();
}
and here i implement it in Students:
public class Students:IStudents
{
public IEnumerable<students> getAll()
{
//return something;
}
}
and then when i want to use in the controller first i should instantiate the IStudent class and the use its method,but instead i IStantiate the Students class and use the method directly from there,whats the advantages of this interface class here?!