Sample repository class How can I make it shorter and cleaner?

using Queries.Core.Repositories;
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Linq.Expressions;

namespace Queries.Persistence.Repositories
{
public class Repository&lt;TEntity&gt; : IRepository&lt;TEntity&gt; where TEntity : class
{
    protected readonly DbContext Context;

    public Repository(DbContext context)
    {
        Context = context;
    }

    public TEntity Get(int id)
    {
        return Context.Set&lt;TEntity&gt;().Find(id);
    }

    public IEnumerable&lt;TEntity&gt; GetAll()
    {
        return Context.Set&lt;TEntity&gt;().ToList();
    }

    public IEnumerable&lt;TEntity&gt; Find(Expression&lt;Func&lt;TEntity, bool&gt;&gt; predicate)
    {
        return Context.Set&lt;TEntity&gt;().Where(predicate);
    }

    public TEntity SingleOrDefault(Expression&lt;Func&lt;TEntity, bool&gt;&gt; predicate)
    {
        return Context.Set&lt;TEntity&gt;().SingleOrDefault(predicate);
    }

    public void Add(TEntity entity)
    {
        Context.Set&lt;TEntity&gt;().Add(entity);
    }

    public void AddRange(IEnumerable&lt;TEntity&gt; entities)
    {
        Context.Set&lt;TEntity&gt;().AddRange(entities);
    }

    public void Remove(TEntity entity)
    {
        Context.Set&lt;TEntity&gt;().Remove(entity);
    }

    public void RemoveRange(IEnumerable&lt;TEntity&gt; entities)
    {
        Context.Set&lt;TEntity&gt;().RemoveRange(entities);
    }
}
}
If you're worried about repeating Context.Set&lt;TEntity&gt;() about the place, you can assign a field in your constructor instead:

public class Repository&lt;TEntity&gt; : IRepository&lt;TEntity&gt; where TEntity : class
{
    protected readonly DbContext Context;
    protected readonly IDbSet&lt;TEntity&gt; Set;

    public Repository(DbContext context)
    {
        Context = context;
        Set = context.Set&lt;TEntity&gt;();
    }

    public TEntity Get(int id)
    {
        return Set.Find(id);
    }
}


I would say that I don't generally like generic repositories but I won't get in to that now. A lot of people use the pattern and I don't know of any canonical 'this is bad' sources so am happy to disagree over it.

One thing you do need to consider though: multiple column primary keys. That's why Find takes an array (params). You're making a method that will throw if the object has a multiple column primary key (Get).