public IRepository <T> GetRepository <T>() where T : Entity { var repositoryListItem = _repositories.GetRepository <T>(); NHRepository <T> repository; if (repositoryListItem == null) { repository = new NHRepository <T>(_session); _repositories.Add <T>(repository); } else { repository = (NHRepository <T>)repositoryListItem.Repository; } return(repository); }
public IRepository <T> GetRepository <T>() where T : Entity { var repositoryListItem = _repositories.GetRepository <T>(); EFRepository <T> repository; if (repositoryListItem == null) { repository = new EFRepository <T>(_context); _repositories.Add <T>(repository); } else { repository = (EFRepository <T>)repositoryListItem.Repository; } return(repository); }