I'm moving from EF Core 2.2 to 3.1. One breaking change (#15392) was that it no longer composed over stored procedures, so you had to add 'AsEnumerable'. That usually works, but I have a stored procedure call on a TPH table where that fails:
My call to the SPROC is:
SqlParameter authorizedUserID_p = new SqlParameter("@authorizedUserID", authorizedUser.ID); IEnumerable<Post> query = context.Posts.FromSqlRaw<Post>("Post.USP_ReadPost @ID, @AuthorizedUserID", parameters: new[]{ parentID_p, authorizedUserID_p } ).AsEnumerable<Post>(); Post targetPost = query.ToList<Post>().FirstOrDefault<Post>();And it produces this error, recommending using AsEnumberable (which I'm already using above):
System.InvalidOperationException: FromSqlRaw or FromSqlInterpolated was called with non-composable SQL and with a query composing over it. Consider calling
AsEnumerableafter the FromSqlRaw or FromSqlInterpolated method to perform the composition on the client side.I believe the reason is because my Posts table is Table-per-hiearchy, as other calls to SPROCS in the same application are working fine. Would appreciate any help possible!