jonwagner / Insight.Database

Fast, lightweight .NET micro-ORM

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Log auto mapped stored proc input parameters

raidken opened this issue · comments

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)

  • Dotnet version: [netcore2, dotnet472]
  • Database: [SQL Server, Oracle, MySQL]
  • Library version: [6.2.3]

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.

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.

commented

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.