This library provides a way to construct Telerik.DataSourceRequest from route parameters, so you don't need to reference and pass Kendo.Mvc.UI.DataSourceRequest in multiple layers of your project.
Step1 You should install NuGet Package
In Visual Studio
Install-Package TelerikDS.Mvc.Binder
Or using .NET Core CLI
dotnet add package TelerikDS.Mvc.Binder
Step2 Using namespace (you can write it in GlobalUsings.cs)
using DataSourceRequestAttribute = TelerikDS.Mvc.Binder.DataSourceRequestAttribute;
(Note: In the old 1.x version, namespace start with Telerik.DataSource.Mvc.Binder.
)
Mark [DataSourceRequest]
attribute on your parameter
public class HomeController : Controller
{
// ...
public async Task<IActionResult> GetDataSourceAsync([DataSourceRequest] DataSourceRequest dsRequest)
{
return Json(await _dataSourceService.GetDataSourceAsync(dsRequest));
}
}