Reputation: 41
Example:
public class Address
{
public string Address1 {get; set;}
public string Address2 {get; set;}
}
public class User
{
public int Id{get; set;}
//Complex type
public Address Address{get; set;}
}
I have a grid that is fill with data of User. I want to make $orderby by Address, is this posible?
Upvotes: 2
Views: 247
Reputation: 1373
Maybe you should use the List object:
public class AddressObject
{
public string Address {get; set;}
}
public class User
{
public int Id {get; set;}
public List<AddressObject> adressList = new List<AddressObject>();
}
Than you can order with LINQ:
var orderedAdressList = adressList.OrderBy(z => z.Address)
Upvotes: 1