Link to home
Start Free TrialLog in
Avatar of WorknHardr
WorknHardr

asked on

LINQ Group Orderby Sub-Category Not Ascending?

How do I get the categorySub items to orderby ascending?

1.  'Category' item names appear ascending in the View
2.  'CategorySub' item names are NOT in any order.

var categories = from c in context.Categories
                               join s in context.CategorySubs on c.CategoryID equals s.CategoryID
                               let j = new CategoryViewModel { category = c, categorySub = s }
                               orderby s.Name ascending //Not Working...
                               group j by j.category.Name into g
                               select new Group<string, CategoryViewModel> { Key = g.Key, Values = g };
ASKER CERTIFIED SOLUTION
Avatar of kaufmed
kaufmed
Flag of United States of America 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
Avatar of WorknHardr
WorknHardr

ASKER

live and learn, thank you...