How is the Get <T> method used with DynamicParameters?

I am trying to run a test to check if I have loaded the object correctly DynamicParameters

. However, I can't figure out what the type is that I should be using. I am getting exceptions when I try to use C # /. NET types (int, string, etc.). I tried to use SqlDbType but it didn't work. I looked at the source and I can see that the value is stored as IDbDataParameter

and then applied to the type. Obviously, the types I'm trying are not throwing. The data I'm testing is this int

. How can I get the values?

var dbParams = new DynamicParameters();
dbParams.Add( "Field1", 1 );
var value = dbParams.Get<int>( "Field1" ); // throws an exception

      

+3


source to share


1 answer


Only the expected code Get<T>

to be used after has been called by SQL to get the updated parameter value ref

, out

and return

. Consequently, he tried to remove the link from something that did not yet exist. This will be fixed in the next release ( it is fixed in the tuba now ).



+3


source







All Articles