I'm trying to call a stored procedure to retrieve a single record using EF Core but I keep getting the exception:
System.InvalidOperationException: 'FromSqlRaw or FromSqlInterpolated was called with non-composable SQL and with a query composing over it. Consider calling AsEnumerable
after the FromSqlRaw or FromSqlInterpolated method to perform the composition on the client side.'
Here: ef-core-3.0 breaking-changes it is recommended to use use .AsEnumerable() but it has no effect. I don't see why it thinks I'm trying to compose over this SQL code:
var result = context.Set<TicketDetails>()
.FromSqlInterpolated($"EXECUTE GetTicket @TicketId = {id}")
.AsEnumerable()
.FirstOrDefault();
Also here is a similar issue that didn't give a solution for me.