Different ODataOptions per EdmModel
Open
@xuzhg is already working on this.
Since Apr 4, 2023.
question
- Dominant language
- C#
- Stars
- 505
- Forks
- 186
- PR merge metrics
- No merged PRs in 30d
Description
Hi, is it possible to specify different ODataOptions per different EdmModels?
For instance, currently it's possible to set RouteOptions.EnableQualifiedOperationCall setting like so:
IEdmModel model1 = EdmModelBuilder.GetEdmModel(v1Configurations);
IEdmModel model2 = EdmModelBuilder.GetEdmModel(v2Configurations);
services
.AddControllers()
.AddOData(opt =>
{
opt.Count().Filter().Expand().Select().OrderBy().SetMaxTop(1000)
.AddRouteComponents("api/v1/odata", model1, DefaultODataConfigureServices(model1));
// Removes need for namespaced actions (e.g. Default.MyCustomAction becomes MyCustomAction)
opt.RouteOptions.EnableQualifiedOperationCall = false;
}
Suppose I want to have v1 EdmModel route components to have EnableQualifiedOperationCall = false but now want to add v2 EdmModel route components to have EnableQualifiedOperationCall = true.
Is this possible to do? Repeating AddOData a second time after the first one just applies this as the new setting for all route component EdmModels.
Contributor guide
No contributing guide indexed for this repository
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.
Assessment
This issue has not been assessed yet.