var query = db.Posts.OrderBy(p => p.Blog).ToList();
At present when there is query which is ordering by an entity type, when evaluated on server converts orderby clause to ordering on PK properties. Since this happens during SqlTranslation, InMemory does not do this. Because of this, if entityType does not implement IComparer then InMemory throws exception whereas relational provider would just work fine. On the other hand, if there IComparer implemented and has different comparison order than keys then relational results would be incorrect.
We should decide on one behavior and make it consistent across relational/non-relational providers.
At present when there is query which is ordering by an entity type, when evaluated on server converts orderby clause to ordering on PK properties. Since this happens during SqlTranslation, InMemory does not do this. Because of this, if entityType does not implement IComparer then InMemory throws exception whereas relational provider would just work fine. On the other hand, if there IComparer implemented and has different comparison order than keys then relational results would be incorrect.
We should decide on one behavior and make it consistent across relational/non-relational providers.