https://github.com/linmasaki/kendo.dynamiclinqcore2
Kendo.DynamicLinq for .Net Core 2.0
https://github.com/linmasaki/kendo.dynamiclinqcore2
kendo kendo-ui linq netcore2 netcore20
Last synced: over 1 year ago
JSON representation
Kendo.DynamicLinq for .Net Core 2.0
- Host: GitHub
- URL: https://github.com/linmasaki/kendo.dynamiclinqcore2
- Owner: linmasaki
- Created: 2017-10-10T16:43:39.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-01-29T06:50:44.000Z (over 8 years ago)
- Last Synced: 2025-02-01T20:14:53.521Z (over 1 year ago)
- Topics: kendo, kendo-ui, linq, netcore2, netcore20
- Language: C#
- Size: 15.6 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Kendo.DynamicLinqCore2.0
[](https://www.nuget.org/packages/Kendo.DynamicLinqCore2)
# Note
Kendo.DynamicLinqCore2 is referred to Kendo.DynamicLinq by [kendo-labs](https://github.com/kendo-labs/dlinq-helpers).
Related notes can refer it.
## Description
Kendo.DynamicLinqCore2 implements server paging, filtering, sorting and aggregating via Dynamic Linq for .Net Core2.0.
## Build NuGet Package
1. Open command line console
2. Switch to project root directory.(src\Kendo.DynamicLinqCore2)
3. Run "dotnet restore"
4. Run "dotnet pack --configuration release"
## Usage
1. Add the Kendo.DynamicLinqCore2 NuGet package to your project.
2. Configure your Kendo DataSource to send its options as JSON.
parameterMap: function(options, type) {
return JSON.stringify(options);
}
3. Configure the `schema` of the DataSource.
schema: {
data: "Data",
total: "Total",
aggregates: "Aggregates",
groups: "Group"
}
4. Import the Kendo.DynamicLinqCore2 namespace.
5. Use the `ToDataSourceResult` extension method to apply paging, sorting and filtering.
[WebMethod]
public static DataSourceResult Products(int take, int skip, IEnumerable sort, Filter filter, IEnumerable aggregates, IEnumerable group)
{
using (var northwind = new Northwind())
{
return northwind.Products
.OrderBy(p => p.ProductID) // EF requires ordering for paging
.Select(p => new ProductViewModel // Use a view model to avoid serializing internal Entity Framework properties as JSON
{
ProductID = p.ProductID,
ProductName = p.ProductName,
UnitPrice = p.UnitPrice,
UnitsInStock = p.UnitsInStock,
Discontinued = p.Discontinued
})
.ToDataSourceResult(take, skip, sort, filter, aggregates, group);
}
}
## Other Examples
This example has full demo with .Net Core2.0 by [Vahid Nasiri](https://github.com/VahidN).
- [KendoUI.Core.Samples](https://github.com/VahidN/KendoUI.Core.Samples)