We have multiple classes/entities
and wants to implement single query
for all these types. Basically we want to implement a Query
something like this.
public class Query<TEntity>
{
private readonly IGenericRepository<TEntity> _genericRepository;
public Query(IGenericRepository<TEntity> genericRepository)
{
_genericRepository = genericRepository;
}
public List<TEntity> GetCountries()
{
return _genericRepository.GetAll();
}
}
Can you please give any hint or reference for the similar problem?