I am using the overload of ToDataSourceResult to postproceess my DBContext Entity into my model. However, I receive a LINQ error when I use it in the manner below. I know LINQ enough to understand the error, but I am confused because this forum post seemed to indicate the postprocessing expression would be used AFTER the object has been retrieved from the DBContext and not as part of the retrieval from the DBContext. Can you provide clarification?
My code:
DataSourceResult result = this.StateProvinceService
.GetQueryable()
.ToDataSourceResult<StateProvince, StateProvinceModel>(
request,
province => Mapper.Map<StateProvince, StateProvinceModel>(province));
The result:
My code:
DataSourceResult result = this.StateProvinceService
.GetQueryable()
.ToDataSourceResult<StateProvince, StateProvinceModel>(
request,
province => Mapper.Map<StateProvince, StateProvinceModel>(province));
The result: