Link to home
Start Free TrialLog in
Avatar of Charles Baldo
Charles BaldoFlag for United States of America

asked on

Need Order by in LINQ

New to Linq.

I need to add an order by on the new  AppResourceDetails().Need to order by on arg.GroupDescription

appResourceDetails = context.AppResources                    
                        .Where(ar => ar.AppId == appId && ar.GroupId != UserDefinedReports)
                        .Join(context.AppResourceGroups, ar => new { ar.GroupId, ar.AppId }, arg => new { arg.GroupId, arg.AppId },
                        (ar, arg) => new AppResourceDetails()
                        {
                              ResourceId = ar.ResourceId,
                              ResourceTypeId = ar.ResourceTypeId,
                              ResourceDescription = ar.ResourceDescription,
                              ResourceComment = ar.ResourceComment,
                              CreateDate = ar.CreateDate,
                              ExpirationDate = ar.ExpirationDate,
                              GroupId = ar.GroupId,
                              GroupDescription = arg.GroupDescription
                        }).ToList();

Appreciated
thank you
ASKER CERTIFIED SOLUTION
Avatar of Fernando Soto
Fernando Soto
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 Charles Baldo

ASKER

Perfect,  Thank you kindly
Not a problem, glad to help.