Skip to content

[C#] use SqlDecimal.WriteTdsValue for .NET 7+ to avoid allocating a byte[] array #41349

@nmishturak-gl

Description

@nmishturak-gl

Describe the enhancement requested

In .NET 7+ there is an option to use SqlDecimal.WriteTdsValue to avoid allocating a byte[]

// TODO: Consider groveling in the internals to avoid the probable allocation
Span<int> span = bytes.CastTo<int>();
value.Data.AsSpan().CopyTo(span);

Component(s)

C#

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions