0

I am looking at a piece of code written for Kendo which looks like following:

public ActionResult ReadEmployee([DataSourceRequest]DataSourceRequest request)
    {
        return Json(GetEmployees().ToDataSourceResult(request), JsonRequestBehavior.AllowGet);
    }

I have few questions about it:

  1. Is DataSourceRequest a kind of ActionResult?
  2. Since it is used in confines of KendoUI, I am not able to understand the nature of this object in much more detail.

What is exact role of this object? Is there any documentation which explains it in details?

abatishchev
  • 98,240
  • 88
  • 296
  • 433
Lost
  • 12,007
  • 32
  • 121
  • 193

2 Answers2

1

in summary it is a model binder for Kendo.

ModelBinding is the mechanism ASP.NET MVC uses to create strongly-typed objects (or fill primitive-type parameters) from the input stream (usually an HTTP request).

for more information check what is modelBinder

Community
  • 1
  • 1
M.Azad
  • 3,673
  • 8
  • 47
  • 77
1

All the paging and sorting logic that a grid provides is in that object. So you make an IQueryable and then all the paging magic happens in the ToDataSourceResult method.

Thomas Koelle
  • 3,416
  • 2
  • 23
  • 44