Proper implementation of generic repository
To get it to work, use IEnumerable&lt;T&gt; instead of List&lt;T&gt; as it's covariant:

public interface IRep&lt;out T&gt;
{
    IEnumerable&lt;T&gt; GetAll();
}

public interface IEntity
{
    int Id { get; set; }
}

public class Customer: IEntity
{
    public int Id { get; set; }
    public string Name { get; set; }
    public int Age { get; set; }
}

public class Product: IEntity
{
    public int Id { get; set; }
    public string Code { get; set; }
    public decimal Price {get;set;}
}

public class RepProduct: IRep&lt;Product&gt;
{
    public IEnumerable&lt;Product&gt; GetAll()
    {
        List&lt;Product&gt; list = new List&lt;Product&gt;();
        list.Add(new Product() {Id=1, Code = "burger", Price = 2.99M});
        list.Add(new Product() {Id=1, Code = "fries", Price = 1.99M});
        list.Add(new Product() {Id=1, Code = "pepsi", Price = 1.99M});
        return list;
    }
}

public class RepCustomer: IRep&lt;Customer&gt;
{
    public IEnumerable&lt;Customer&gt; GetAll()
    {
        List&lt;Customer&gt; list = new List&lt;Customer&gt;();
        list.Add(new Customer() {Id=1,Name="Fred", Age=44   });
        list.Add(new Customer() {Id=2,Name="Victoria", Age=13   });
        list.Add(new Customer() {Id=3,Name="Kiefer", Age=10 });
        return list;
    }
}

void Main()
{
    IRep&lt;IEntity&gt; rep = null;

    rep = new RepCustomer();
    Console.WriteLine(rep.GetAll());

    rep = new RepProduct();
    Console.WriteLine(rep.GetAll());
}