Returning IQueryable from my repository in Repository pattern design pattern I am developing an application based on Repository design pattern. What should be the return type from the Repository? 

This is my UserRepository class:

public class UserRepository : Repository&lt;UserMaster&gt;, IUserRepository
{
    public UserRepository(DbContext context)
        : base(context)
    {

    }
    public UserMaster GetById(int id)
    {
        return FindBy(x =&gt; x.Userid == id).FirstOrDefault();
    }

}


The base Repository class:

public abstract class Repository&lt;T&gt; : IRepository&lt;T&gt;
  where T : class
{
    protected DbContext _entities;
    protected readonly IDbSet&lt;T&gt; _dbset;

    public Repository(DbContext context)
    {
        _entities = context;
        _dbset = context.Set&lt;T&gt;();
    }

    public virtual IQueryable&lt;T&gt; GetAll()
    {

        return _dbset.AsQueryable&lt;T&gt;();
    }

    public IQueryable&lt;T&gt; FindBy(System.Linq.Expressions.Expression&lt;Func&lt;T, bool&gt;&gt; predicate)
    {

        IQueryable&lt;T&gt; query = _dbset.Where(predicate).AsQueryable();
        return query;
    }

    public virtual T Add(T entity)
    {
        return _dbset.Add(entity);
    }

    public virtual T Delete(T entity)
    {
        return _dbset.Remove(entity);
    }

    public virtual void Edit(T entity)
    {
        _entities.Entry(entity).State = System.Data.Entity.EntityState.Modified;
    }

    public virtual void Save()
    {
        _entities.SaveChanges();
    }
}


Is this the right way to return IQueryable from the repository? If I want to join two tables, where should I implement the join logic? Inside or outside the repository?

Currently my return type is IQueryable from the Repository and I am doing join on the Business layer after calling GetAll() function (returns IQueryable) of the required tables. Is this the right approach?
IQueryable is a leaky abstraction(you don't wan't to know anything about sql in the service layer).
It is also very difficult to test.

I would recommend not returning IQueryable.
I would return IEnumerable or ICollection and make my queries run in the repository(ToList on the repository).

I would create queries in my repositories to handle the joins.
You can test your queries separately for correctness and performance.