This is a migrated thread and some comments may be shown as answers.

How do I connect a KendoUI Complete ASP.NET with wrappers controller to a db model built using ORM Domain?

1 Answer 47 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Larry
Top achievements
Rank 1
Larry asked on 23 Mar 2013, 05:46 PM
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);
return Json(result);
}

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.

Thanks,
Larry

1 Answer, 1 is accepted

Sort by
0
Larry
Top achievements
Rank 1
answered on 26 Mar 2013, 06:11 PM
Got it myself.
Larry
Tags
Grid
Asked by
Larry
Top achievements
Rank 1
Answers by
Larry
Top achievements
Rank 1
Share this question
or