Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Avoid boxing in DbParameter.Value?

I'm using ADO.NET to communicate some db, and searching for a way to avoid boxing when setting the DbParameter.Value property to value-type.

Is there a way to avoid boxing in DbParameter.Value?

Thanks.

like image 962
DxCK Avatar asked Jul 06 '26 13:07

DxCK


1 Answers

Why do you want to avoid it? The performance cost of boxing is probably next to nothing in the context of the overall data access layer. Serializing the parameter value on the wire alone is probably 100 times the cost of boxing. Are you seeing a performance problem attributable to boxing?

like image 84
Josh Avatar answered Jul 08 '26 03:07

Josh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!