Repository navigation
Union type support for parameters to remove boxing #4674
JustABearOz
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi, one of the long standing issues with Sql Client has been boxing/unboxing of value types. It's been near impossible to fix this without breaking changes to the API.
With Union Types, I feel that this could finally be solved. Adding new constructors for SqlParameter that allow union types like:
public SqlParameter(string name, int | DbNull value) while still keeping the existing SqlParameter(string name, object value) could work.
This would then allow internal changes to SqlParameter that could potentially reduce or eliminate boxing, reduce allocations, even simplify TDS serialization as types are now known and could be simplified to a simple switch..
All reactions