Hello,
I am having trouble using the ToDataSourceResult method in combination with NHibernate.
Here is a minimal example of what I'm doing:
using ( var session = NHibernate.DefaultFactory.OpenStatelessSession())
{
IQueryable<MyDataRow> myQuery = session.Query<MyDataRow>();
DataSourceResult myResult = dataRowRepo.ToDataSourceResult(request, x => new ListRowViewModel()
{
ID = x.ID,
Property2 = x.Property2
});
return Json(myResult, JsonRequestBehavior.AllowGet);
}
This works perfectly fine as long as I don't try to use aggregate or grouping. As soon as I start that my service returns something like this:
Specified method is not supported.
Or for aggregation:
Query Source could not be identified: ItemName = x,
ItemType = MyDataRow, Expression
= from MyDataRow x in
value(NHibernate.Linq.NhQueryable`1[MyDataRow])
And help or suggestions would be greatly appreciated.
I am having trouble using the ToDataSourceResult method in combination with NHibernate.
Here is a minimal example of what I'm doing:
using ( var session = NHibernate.DefaultFactory.OpenStatelessSession())
{
IQueryable<MyDataRow> myQuery = session.Query<MyDataRow>();
DataSourceResult myResult = dataRowRepo.ToDataSourceResult(request, x => new ListRowViewModel()
{
ID = x.ID,
Property2 = x.Property2
});
return Json(myResult, JsonRequestBehavior.AllowGet);
}
This works perfectly fine as long as I don't try to use aggregate or grouping. As soon as I start that my service returns something like this:
Specified method is not supported.
Or for aggregation:
Query Source could not be identified: ItemName = x,
ItemType = MyDataRow, Expression
= from MyDataRow x in
value(NHibernate.Linq.NhQueryable`1[MyDataRow])
And help or suggestions would be greatly appreciated.