Link to home
Start Free TrialLog in
Avatar of TheReckter
TheReckter

asked on

Create a class that implements IOrderedQueryable

Hello, im currently looking for help in creating a class that implements IOrderedQueryable, in my situation the class will have a struct which contains the various fields that I would need to order by, for example:

Class: Person
Struct: Person.Data
Person.Data.Name (string
Person.Data.Age (int)

Help would be greatly appreciated, thank you
Avatar of REA_ANDREW
REA_ANDREW
Flag of United Kingdom of Great Britain and Northern Ireland image

What interface is that?
Avatar of TheReckter
TheReckter

ASKER

the interface is IOrderedQueryable, I would like to implement it in a class called People. which is a list of the Person objects.  Within each person object is a struct called data which has the following public variables:
string Name
int Age
now I want to be able to sort the Person objects within the People class via Name and Age, im not sure whether the IOrderedQueryable interface is the best way to do it
ASKER CERTIFIED SOLUTION
Avatar of REA_ANDREW
REA_ANDREW
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
It is found in System.Linq.  I believe the System.Linq namespace was created for 3.5 of the .NET framework, so maybe thats why you cant find it.  Ok, I will check out that interface, thank you.
and thankyou for the pointer.  I will have a peek at that cheers :)

Andrew