Charles Baldo
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.AppResourceG roups, 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
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.AppResourceG
(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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Not a problem, glad to help.
ASKER