Code:public class BaseRepository<T> where T : class { protected BaseRepository() { } protected static BaseRepository<T> _instance; public virtual BaseRepository<T> Instance { get; } public class UserRepository : BaseRepository<Employee> { public override BaseRepository<Employee> Instance { get { if (_instance== null) { _instance = new UserRepository(); } return UserRepository._instance; } } }