Just started playing around with API's and trying to work out how to run a Stored Procedure. I have added this method below to my Minimal API. As far as I can tell the Stored Procedure runs but returns the first line of data over and over.
app.MapGet("/AllProducts/{LocationID}", (DataContext context, int LocationID) => context.AllLocationProducts.FromSqlRaw($"GetProducts @LocationNumber='{LocationID}'").ToListAsync());
Here is the result if I run in SQL.
Any help would be appreciated.
I have tried different sql method but same result.
I managed to work out the issue, my Model for the Stored Procedure wasn't correct.