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 };
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER