SQL Server: support for mapping user defined types (UDT)
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Domain
- backend-api-design, databases
Research direction
Start by reading the SqlClient for .NET Core 2.1 changes and the linked corefx issue 29139, then trace the EF Core SQL Server provider’s type-mapping and query paths. Done means custom UDT mappings can be registered and values can be read, passed as parameters, and used as literals, without expanding scope to spatial or hierarchyid support.
Written by the indexing model from the issue text.
Description
This issue is about being able to use properties of .NET types that are registered as UDT types on SQL Server.
This issue is not about supporting SQL Server spatial or hierarchyid types, which happen to be implemented like UDTs. Directly mapping to SQL Server spatial types is already enabled in 2.1 wherever the types are available (currently only .NET Framework), and our full spatial story is tracked at https://github.com/aspnet/EntityFrameworkCore/issues/1100. I am splitting this issue from supporting hierachyid that was originally reported at https://github.com/aspnet/EntityFrameworkCore/issues/365, because I believe in order to property support hierarchyid we would need additional function mapping.
Enabling SQL Server UDTs would involve adding APIs to register custom type mappings and making sure you can issue queries that read values or pass parameters or even literals of these types.
The necessary features were added in SqlClient for .NET Core in 2.1. Note that UDTs need CLR types that are registered on the server and available on the client for the ADO.NET layer. SqlClient’s mechanism happens to be very simple but also inflexible. Here is a call to create a true plug-in model:
https://github.com/dotnet/corefx/issues/29139.
- Dominant language
- C#
- Stars
- 14.8k
- Forks
- 3.4k
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 134
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dotnet/efcore
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
-
customer-reported
Difficulty 5/5 Over a week Newbie friendliness 38/100
-
area-cosmos area-vector-search
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
area-cosmos
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
area-tools needs-design
Difficulty 4/5 3-5 days Newbie friendliness 25/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
:watch: Not Triaged 11.0 fundamentals/subsvc
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
dotnet/AspNetCore.Docs#37699 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
SubtitleEdit/subtitleedit#15108 · 1 comment ·
-
area/docs-content Bug pulumi/docs
Difficulty 1/5 1-3 hours Newbie friendliness 94/100
-
agentic-workflows untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 76/100