I am using Repository design pattern "Martin's Fowler" in my application (MVC3, WebForms) also i use "ONLY ONE" DbContext ("Singletone") through out all of my application.
Details: Repository is looks like that,
class Repository<T> : IRepository<T>, IUnitOfWork
only one repository wich i create many more repositories, like so:
class UserRepository {
private IRepository<User> _repository;
//dependency injection via constructor using Ninject
public UserRepository(IRepository<User> repository) {
_repository = repository;
}
}
and so on...
What is best practice in these cases, what you are suggestion to make better???
I have to increase my performance and of course to learn the correct way to do it.
Thank you all for the answers.