Я новичок в шаблоне репозитория, но я пробовал, моя цель - создать дизайн, который позволит мне легко с помощью всего лишь нескольких правок «внедрения зависимостей или правок конфигурации» иметь возможность переключиться на другой ORM, не касаясь других слоев решения.
Я достиг этой реализации: 
а вот код:
public interface IRepository<T>
{
T Get(int key);
IQueryable<T> GetAll();
void Save(T entity);
T Update(T entity);
// Common data will be added here
}
public interface ICustomerRepository : IRepository<Customer>
{
// Specific operations for the customers repository
}
public class CustomerRepository : ICustomerRepository
{
#region ICustomerRepository Members
public IQueryable<Customer> GetAll()
{
DataClasses1DataContext context = new DataClasses1DataContext();
return from customer in context.Customers select customer;
}
#endregion
#region IRepository<Customer> Members
public Customer Get(int key)
{
throw new NotImplementedException();
}
public void Save(Customer entity)
{
throw new NotImplementedException();
}
public Customer Update(Customer entity)
{
throw new NotImplementedException();
}
#endregion
}
использование на моей странице aspx:
protected void Page_Load(object sender, EventArgs e)
{
IRepository<Customer> repository = new CustomerRepository();
var customers = repository.GetAll();
this.GridView1.DataSource = customers;
this.GridView1.DataBind();
}
Как вы видели в предыдущем коде, теперь я использую LINQ to sql, и, как вы видите, мой код привязан к LINQ to sql, как изменить дизайн этого кода для достижения моей цели «иметь возможность легко перейти на другой ORM, например в структуру сущностей ADO.net, или дозвуковой "
Пожалуйста, посоветуйте с простым образцом кода