Select on Required Column In N hibernate Query Over and return data in QueryOver

ساخت وبلاگ

Vote count: 0

I have the following function now i want to select only name and some other column from this method i have try this

private QueryOver<Request> CreateFilter(RequestFilterDTO filter)
{ var query = QueryOver.Of<Request>() query.SelectList(list => list .Select(pr => pr.Name) .Select(pr => pr.Color) .Select(pr => pr.ListPrice) .List<Request>(); retu query;
}

This give me an error NHibeate.Criterion.Lambda.QueryOverProjectionBuilder<Optime.SWF.Model.Requests.Request> does not contain a definition for List and no extension method List accepting a first argument of type NHibeate.Criterion.Lambda.QueryOverProjectionBuilder<Optime.SWF.Model.Requests.Request> could be found (are you missing a using directive or an assembly reference?)

how i can fix this?

Note : The retu type i want to QueryOver<Request> with the selection then i send the createfilter method to my Base Repository

asked 1 min ago

back soft...
ما را در سایت back soft دنبال می کنید

برچسب : نویسنده : استخدام کار backsoft بازدید : 366 تاريخ : جمعه 31 ارديبهشت 1395 ساعت: 17:40