forked from OData/AspNetCoreOData
-
Notifications
You must be signed in to change notification settings - Fork 0
3. Order by
ArnaudB88 edited this page Feb 11, 2025
·
1 revision
using OData2Linq;
using System;
using System.Linq;
IQueryable<Sample> dataSet = Sample.CreateQuerable();
Sample[] filterResult = dataSet.OData().OrderBy("Id desc,Name asc").ToArray();
foreach (Sample sample in filterResult)
{
Console.WriteLine("Id:{0} Name:{1}", sample.Id, sample.Name);
}
Id:3 Name:name3
Id:2 Name:name2
Id:1 Name:name1