System.Linq.Dynamic.Core icon indicating copy to clipboard operation
System.Linq.Dynamic.Core copied to clipboard

try to call function inside select

Open mahdiyar021 opened this issue 1 year ago • 1 comments

im trying to call function inside select for get row number this work totally fine on normal linq select like :

db.JsonWebTokens
               .Select(x=>new { Rank = Microsoft.EntityFrameworkCore.EF.Functions.RowNumber(EF.Functions.Over().OrderBy(x.Id)), x.Id }).ToArray();

but this not working on dynamic linq :

 var res = db.JsonWebTokens
     .Select("x=>new { Microsoft.EntityFrameworkCore.EF.Functions.RowNumber(EF.Functions.Over().OrderBy(x.Id))  as Rank, x.Id }")
     .ToDynamicArray();

row number from extend library Zomp.EFCore.WindowFunctions.

exception : Enum type 'Microsoft.EntityFrameworkCore.EF.Functions' not found

mahdiyar021 avatar Feb 14 '24 11:02 mahdiyar021

Probably related to https://github.com/zzzprojects/System.Linq.Dynamic.Core/issues/772

StefH avatar Feb 15 '24 10:02 StefH

PR merged, a new NuGet will be released in some time

StefH avatar Feb 29 '24 08:02 StefH

tnx

mahdiyar021 avatar Mar 10 '24 17:03 mahdiyar021