Posted 23 Mar 2013
Link to this post
http://docs.kendoui.com/getting-started/using-kendo-with/aspnet-mvc/helpers/grid/ajax-binding gives an example:
public ActionResult Products_Read([DataSourceRequest]DataSourceRequest request)
var products = new NorthwindDataContext().Products;
DataSourceResult result = products.ToDataSourceResult(request);
The setting up of the Grid works fine using a direct read of the db. So now I have built my project as KendoUIMVCApplicaition1 and have connected to my database via EntityModel.cs in the EntityModel.rling directory within the application. Its all there and I can see all the tables and the diagram.
I just cannot get the code in my controller to connect to the model. So the questions:
1. How is "NorthwindDataContext()" established and how do I know its name in my solution? If I change it to var contacts = new TblNAsContact; I get no errors. But...
2. When I try to return contacts.ToDataSourceResult(request); it gives me errors that TblNAsContact does not contain a method called ToDataSourceResult. In looking at the EntityModel.cs I can see it doesn't.
So the question is really beginner basic. How do I use KendoUI MVC Complete with wrappers to access a model built using ORM? Is there a current blog or sample application? Most of what I have found seems to predate the use of KendoUI Complete for ASP.NET with wrappers and is code intensive while the new solution appears to be a huge productivity improvement.