asp.net - Linq to SQL 2016 Stored Procedure OFFSET FETCH NEXT incorrect return type -


i have interesting issue has kept me googling couple of days.

i executing stored store procedure implements offset fetch next custom .net paging.

the entity framework can't seem figure out correct return type. thinks trying return int instead of result set. therefore can not use select.

sproc code:

  @param1 bit = null,   @param2 bit = null,   @pagenumber int = 1,   @rowspage int = 10   select        id, name           table          (@param1 null or (param1 = @param1 ))          , (@param2 null or (param2  = @param2 ))    order name desc   offset ((@pagenumber - 1) * @rowspage) rows   fetch next @rowspage rows 

linq code:

var result = context.storedproceure(params).select(s => new object { blah =  s.blah, blah1 = s.blah1}).tolist(); 

error: 'int' not contain definition 'select' , no extension method 'select' accepting first argument of type 'int' found (are missing using directive or assembly reference?)

linq can figure out complex result type if remove offset next command.

how can entity framework figure out result type?

i've tried:

set nocount on;

set fmtonly off;

neither seem make difference...


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -