I am using Dapper's DynamicParamters object with the template argument to generate arguments with my entities. After I make my call to my stored procedure I am getting the following error "Procedure or function sp_MemberSave has too many arguments specified.". I do have extra properties on some of my entities for business logic, etc. Is there a way to make sure dapper only passes parameters that are actual parameters for the stored procedure? It seems like Dapper would read the stored procedure first and then set the parameters, that way it would only use the ones that are correct. How can I limit the parameters using the template capabilities?
Try creating an anonymous type of the appropriate parameters from your object... If your class has A, B, C, and D, and you only need A and B:
DynamicParameters(new { A = entity.A, B = entity.B });
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