Support strongly typed dictionaries for dynamic properties
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
Note that open property type constraint is a collection, so an ideal implementation of modelbuilder would look for any dictionaries and generate an open property type constraint for the value type in each such dictionary, and then the AspNetCore.OData serializer/deserializer would read/write the open properties to/from the appropriate dictionary.