D
D
Dmitry2016-08-21 01:40:10
ASP.NET
Dmitry, 2016-08-21 01:40:10

Is it possible to make a universal repository that can work with both EF and ADO.NET?

Can you tell me if it is possible to make a universal repository that can work with both EF and ADO.NET?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Ogoun Er, 2016-08-24
@Ogoun

Of course, you can even in principle not know what will happen at the physical level. Though MongoDB, though a binary file.

public interface IRepository<T>
where T: IEntity
{
    T Get(Guid Id);
    void Post(T entity);
    void Remove(Guid id);
}

public class EFRepository<T>: IRepository<T>
where T: IEntity
{
/*Логика для EF*/
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question