Hi,
I'm currently testing the kendo MVC Grid with Ajax Binding, and i have a getPedidosByColabId function in my repository, and a controller with GetListaGrid function that returns data to populate the grid and i'm getting this error "Public member 'ToDataSourceResult' on type 'ObjectQuery(Of PedidoDocumentacaoViewModel)' not found.". Any Help?
Public Function getPedidosByColabId(ByVal idColaborador As Integer) Dim listaPedidos = (From l In db.tblPEDDOC__tblPedidoDocumentacao Where l.idColaborador = idColaborador Select New PedidoDocumentacaoViewModel With { .idPedidoDocumentacao = l.idPedidoDocumentacao, .idEstadoPedidoDoc = l.idEstadoPedidoDoc, .descEstadoPedidoDoc = l.tblPEDDOC__tblEstadoPedidoDoc.descEstadoPedidoDoc, .idTipoPedidoDoc = l.idTipoPedidoDoc, .descTipoPedidoDoc = l.tblPEDDOC__tblTipoPedidoDoc.descTipoPedidoDoc, .data = l.data }) Return listaPedidos End Function
Public Function GetListaGrid(<DataSourceRequest()> request As DataSourceRequest) As ActionResult Dim idColaborador As Integer = 979 Dim pRepository As New PedidosRepository Dim res = pRepository.getPedidosByColabId(idColaborador) Dim result As DataSourceResult = res.ToDataSourceResult(request) Return Json(result) End FunctionEdit: Already solved it..
Dim result As DataSourceResult = New DataSourceResult With {.Data = res}
Sorry for the trouble
Thanks,
Ricardo Castro