EntityFramework uses IQueryable to enable Linq-To-Sql for context.Orders.
The difference is that IQueryable is the interface that allows
LINQ-to-SQL (LINQ.-to-anything really) to work. So if you further
refine your query on an IQueryable, that query will be executed in
the database, if possible.
For the IEnumerable case, it will be LINQ-to-object, meaning that
all objects matching the original query will have to be loaded into
memory from the database.
For more info see: Returning IEnumerable<T> vs. IQueryable<T>
Edit 29/01/2018
If your class has extension methods with the same name defined for 2 interfaces
Here's what the results will be:
public interface IA
{
void SayHello();
}
public interface IB
{
void SayHello();
}
public class AB: IA,IB
{
//If two interfaces have methods with same signature,
//They can both be implemented by prefixing interface name for one of them.
void IA.SayHello()
{
Console.WriteLine("Hello A");
}
void IB.SayHello()
{
Console.WriteLine("Hello B");
}
public void SayHello()
{
Console.WriteLine("Hello AB");
}
}
public static class MyClassExt
{
public static void SayBye(this IA a)
{
Console.WriteLine("Bye from A");
}
public static void SayBye(this IB b)
{
Console.WriteLine("Bye from B");
}
public static void SayBye(this AB ab)
{
Console.WriteLine("Bye from AB");
}
}
var obj = new AB();
obj.SayHello(); //Hello AB
((IA)obj).SayHello(); //Hello A
((IB)obj).SayHello(); //Hello B
obj.SayBye(); //Bye AB
((IA)obj).SayBye(); //Bye A
((IB)obj).SayBye(); // Bye B
you can also get the LinqPad script at Test inheritence and extension methods.linq