Q:

How to Read data from generic repository in ASP.NET controller class?

I am using ASP.NET mvc 5 in visual studio 2013 and tending to read data from function table (SQL Server) in the controller class via generic repository. I have IGenericRepository which has IQueryable one function, I have GenericRepository class where i am implementing this interface. I got FunctionContext which is inherited from baseContext. The reason i have baseContext so all the dbcontexts can use one path to hit database but same time keep number of table limited to business need.
I have manage to implement genericRepository  but seems getting null data against _dbSet while debugging in GenericRepository and I cant read data in controller class either there plus getting error on 
"var query" 
An exception of type 'System.InvalidOperationException' occurred in EntityFramework.dll but was not handled in user code
many thanks in advanced....
Generic Repository Interface
 public interface IGenericRepository<TEntity> : IDisposable
{
    IQueryable<TEntity> GetAll(); 

}

Generic Repository
public class GenericRepository<TEntity> : IGenericRepository<TEntity> where TEntity : class
{
    protected DbSet<TEntity> _DbSet;
    private readonly DbContext _dbContext;

    public GenericRepository()
    {

    }

    public GenericRepository(DbContext dbContext)
    {
        this._dbContext = dbContext;
        _DbSet = _dbContext.Set<TEntity>();
    }

    public IQueryable<TEntity> GetAll()
    {
        return _DbSet;
    }

    public void Dispose()
    {

    }
}

BaseContext
 public class BaseContext<TContext> : DbContext where TContext : DbContext
{
    static BaseContext()
    {
        Database.SetInitializer<TContext>(null);
    }

    protected BaseContext()
        : base("name = ApplicationDbConnection")
    { }
}

FunctionContext
 public class FunctionsContext : BaseContext<FunctionsContext>
{
    public DbSet<App_Functions> Functions { get; set; }
}

Function Mapping class
[Table("Functions")]
public class App_Functions
{
     public App_Functions()
    {
    }

    [Key]
    public int Function_ID { get; set; }

    [StringLength(50)]
    [Required]
    public string Title { get; set; }

    public int Hierarchy_level { get; set; }
}

Function Domain class
 public class Functions
{
    public Functions()
    {

    }

    public int Function_ID { get; set; }
    public string Title { get; set; }
    public int Hierarchy_level { get; set; }
}

Controller class
public class HomeController : Controller
{
    public ActionResult Index()
    {
        using (var repository = new GenericRepository<Functions>(new FunctionsContext()))
        {
               ?????????????????????????????????
             var query = repository.GetAll().Select(x => new Functions
            {
                Function_ID = x.Function_ID,
                Title = x.Title,
                Hierarchy_level = x.Hierarchy_level
            });

            foreach(var item in query)
            {
                var a2 = item.Title;
            }

        }

        return View();
    }
}

A:

The type parameter on your repository constructor is incorrect. It should be 
new GenericRepository<App_Functions>(new FunctionsContext()))

Because App_Functions is the type of the entity.

