You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a query that is working on .net 3
but after I upgraded to .net 6 isn't working anymore
I test the query in SQL and its working but it can't be translated into Linq and give me this exception:
'FromSqlRaw' or 'FromSqlInterpolated' was called with non-composable SQL and with a query composing over it.
Consider calling 'AsEnumerable' after the method to perform the composition on the client side.
make it AsEnumerable doesn't fix it.
stringsqlCheckAllParents=@";WITH cte AS ( SELECT Id, ParentId, Published, IsDeleted FROM Comments h WHERE Id = {0} UNION ALL SELECT p.Id, p.ParentId, p.Published, p.IsDeleted FROM Comments p INNER JOIN cte c ON c.parentId = p.Id )select Id from cte m where IsDeleted = 1 or Published = 0";vardontAllowLoadData=await _comments.FromSqlRaw(sqlCheckAllParents,parentId??0).Select(x => x.Id).ToListAsync().ConfigureAwait(false);if(dontAllowLoadData.Any()){returnnewDataGridViewModel<Comment>{Records=newList<Comment>(),TotalCount=0};}
EF Core version:
Database provider: (Microsoft.EntityFrameworkCore.SqlServer)
Target framework: (.NET 6.0)
The text was updated successfully, but these errors were encountered:
I have a query that is working on .net 3
but after I upgraded to .net 6 isn't working anymore
I test the query in SQL and its working but it can't be translated into Linq and give me this exception:
'FromSqlRaw' or 'FromSqlInterpolated' was called with non-composable SQL and with a query composing over it.
Consider calling 'AsEnumerable' after the method to perform the composition on the client side.
make it AsEnumerable doesn't fix it.
EF Core version:
Database provider: (Microsoft.EntityFrameworkCore.SqlServer)
Target framework: (.NET 6.0)
The text was updated successfully, but these errors were encountered: