Is there a way to to pass a stored procedure name as a string to a function then use reflection to actually get the sp to use in an linq to sql query?
Try this
var sp = typeof(DataContext).GetMethod("GetUsersByID"); //Get the SP
var result = sp.Invoke(DbContext, new object[]{100}); //Execute the SP with 100 as the parameter
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With