I'm writing a function to call a stored procedure given an IDictionary of arguments.
[Function(Name = "dbo.GetTrackingInfo")]
[ResultType(typeof(Shipment))]
[ResultType(typeof(Piece))]
[ResultType(typeof(Item))]
public IMultipleResults GetTrackingInfo(IDictionary<string, object> arguments)
{
var method = (MethodInfo)MethodInfo.GetCurrentMethod();
var argumentsArr = this.Mapping.GetFunction(method).Parameters
.Select(p => arguments.ContainsKey(p.Name)
? NullableExtensions.Convert(arguments[p.Name], p.ParameterType)
: null)
.ToArray();
return (IMultipleResults)this.ExecuteMethodCall(this, method, argumentsArr);
}
I expected Mapping.GetFunction(method).Parameters to return the parameters of the SP, but instead it returned the parameters of this method. Is there any simple way to get the parameters of the underlying SP?