Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IQueryableExtensions.OrderBy doesn't work for properties of derived types #1517

Open
tatarincev opened this issue Feb 4, 2019 · 1 comment
Assignees

Comments

@tatarincev
Copy link
Contributor

tatarincev commented Feb 4, 2019

Technical details:
Currently OrderBySortInfos method cannot sort by properties appeared only in derived types.

Test code example:

//Type registration in factory
AbstractTypeFactory<A>.RegisterType<B>();

class A {};
class B : A
{
public int MyCoolProperty;
public string ToString() {  return MyCoolProperty.ToString(); }
}
var listOfA = new List<A>() { new  B { MyCoolProperty = 10 },  new  B { MyCoolProperty = 5} };
listOfA.AsQueryable().OrderBy("MyCoolProperty").Select(x=> Debug.WriteLine(x.ToString() + " "));
//Invalid (current) output: 10 5
//Valid output: 5 10

Need to fix OrderBySortInfos method and add unit test for this behavior.

@tatarincev tatarincev added this to the Operations milestone Feb 4, 2019
@yecli yecli self-assigned this Feb 20, 2019
yecli added a commit that referenced this issue Feb 20, 2019
…ived types:

- Added support for mixed type IQueryable;
- Added more tests;
@yecli
Copy link
Contributor

yecli commented Feb 20, 2019

@tatarincev Please check, now it works for customers and even sort Contacts properly.

@yecli yecli removed the Training label Feb 20, 2019
@t13ka t13ka removed this from the Operations milestone Dec 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants