jonwagner / Insight.Database

Fast, lightweight .NET micro-ORM
Other
856 stars 145 forks source link

Log auto mapped stored proc input parameters #472

Closed raidken closed 2 years ago

raidken commented 2 years ago

Describe the question

How can I get a handle over the the parameter values mapped for any stored procedure or SQL call. I want to log the mapped parameter

public interface IProductRepo { [Sql("[spGetSimilarProducts]")] IList GetSimilarProducts(Product product); } Product product = new Product(){ ..... }; productRepo.GetSimilarProducts(product); //How do I get the actual parameter bound to the call the stored proc?

Steps to reproduce (if applicable)

jonwagner commented 2 years ago

I'm not sure what you're trying to do.

If you are trying to log your database calls, I'd recommend a logging proxy (EventSourceProxy or something based on castle).

If you are trying to diagnose mapping problems, there's probably an easier way to solve the problem if you post more information.

raidken commented 2 years ago

I need to log database calls along with the parameters passed in the database calls. Especially in the catch block for db calls, need to capture the actual parameters passed into the stored proc call.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.