Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
149169 | Nov 17,2019 05:01 AM UTC | Nov 18,2019 01:23 PM UTC | Blazor | 1 |
![]() |
Tags: Grid |
public Object Post([FromBody]DataManagerRequest dm)
{
// Here we have converted dataSource as list to resolve the problem
IEnumerable DataSource = db.Orders.Select(x => new Order
{
OrderID = x.OrderID,
EmployeeID = x.EmployeeID,
CustomerID = x.CustomerID
}).ToList();
if (dm.Search != null && dm.Search.Count > 0)
{
DataSource = DataOperations.PerformSearching(DataSource, dm.Search); //Search
}
if (dm.Sorted != null && dm.Sorted.Count > 0) //Sorting
{
DataSource = DataOperations.PerformSorting(DataSource, dm.Sorted);
}
if (dm.Where != null && dm.Where.Count > 0) //Filtering
{
DataSource = DataOperations.PerformFiltering(DataSource, dm.Where, dm.Where[0].Operator);
}
int count = DataSource.Cast<Order>().Count();
if (dm.Skip != 0)
{
DataSource = DataOperations.PerformSkip(DataSource, dm.Skip); //Paging
}
if (dm.Take != 0)
{
DataSource = DataOperations.PerformTake(DataSource, dm.Take);
}
return new { result = DataSource, count = count };
}
|
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.