OData / AspNetCoreOData

ASP.NET Core OData: A server library built upon ODataLib and ASP.NET Core
Other
459 stars 160 forks source link

Consider moving model creation for Json controllers into builder/factory class resolved from DI #254

Open dsidedp opened 3 years ago

dsidedp commented 3 years ago

Currently (v8.0.1) there is no way to control automatic model creation for Json controllers inside ODataQueryParameterBindingAttribute and EnableQueryAttribute.

This makes few things much harder to configure, like run EnableLowerCamelCase() on builder before builder.GetEdmModel().

Since both attributes have access to (global) DI container, please consider moving EDM model (or builder) creation to separate builder/factory class resolved via DI.

xuzhg commented 3 years ago

@dsidedp Good idea.