OData / OData/AspNetCoreOData

Support strongly typed dictionaries for dynamic properties

Open
#1,073 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

feature P2
Dominant language
C#
Stars
505
Forks
186
PR merge metrics
No merged PRs in 30d

Description

Assemblies affected
ASP.NET Core OData 8.x
ModelBuilder

Describe the bug
Today, we use the fact that a property of a CLR type is of type Dictionary<string,object> to determine that the type is an open type, and use the Dictionary<string,object> to store dynamic properties.

However, the service may impose an open property type constraint that specifies that dynamic properties are of a specific given type. In this case, the implementation of the dynamic property dictionary should be able to be of that type, for example, Dictionary<string,myAttributeType>. Ideally, modelbuilder would recognize this pattern and automatically apply the open property type constraint annotation to the type.

Work required:
-Support strongly typed dictionaries in AspNetCore.OData.
-Support strongly typed dictionaries in ModelBuilder

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in the ASP.NET Core OData 8.x ModelBuilder area and trace how Dictionary<string,object> identifies open types and stores dynamic properties. Add support for Dictionary<string,T> dynamic properties in both AspNetCore.OData and ModelBuilder, including automatic open property type constraints where applicable.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.