-
Notifications
You must be signed in to change notification settings - Fork 473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Matching parameter by name when binding ODataQueryOptions. #1173
Matching parameter by name when binding ODataQueryOptions. #1173
Conversation
4177cde
to
ea66dea
Compare
? configuration.GetODataRootContainer(routeName) | ||
: configuration.GetNonODataRootContainer(); | ||
|
||
IServiceProvider rootContainer = configuration.GetODataRootContainer(routeName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: the indentation is off by one space from the other lines.
{ | ||
// For HTTP routes, use the default request services. | ||
rootContainer = request.HttpContext.RequestServices; | ||
throw Error.ArgumentNull("routeName"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're throwing argument null exception for "routeName" when perRouteContainer is null? Should this one be an exception for perRouteContainer and a separate if-statement check above for routeName?
throw Error.ArgumentNull("routeName"); | ||
} | ||
IServiceProvider rootContainer = perRouteContainer.GetODataRootContainer(routeName); | ||
if (perRouteContainer == null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate perRouteContainer check here. I think you meant rootContainer?
perRouteContainer.CreateODataRootContainer(null, ConfigureDefaultServices(builder, configureAction)); | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra empty line.
IPerRouteContainer perRouteContainer = builder.ServiceProvider.GetRequiredService<IPerRouteContainer>(); | ||
if (perRouteContainer == null) | ||
{ | ||
throw Error.ArgumentNull("routeName"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question regarding the use of "routeName" as above.
ea66dea
to
e5754c7
Compare
// determination. | ||
if (!contentTypeSpecified && matchedMappings != null && matchedMappings.Any()) | ||
// Now pick the best content type. If a media mapping was found, use that and override the | ||
// value specified by the controller, if any. Otherwiser, let the base class decide. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: Otherwiser -> Otherwise
/// </summary> | ||
/// <param name="configuration">The server configuration.</param> | ||
/// <param name="rootContainer">The root container.</param> | ||
public static void SetNonODataRootContainer(this HttpConfiguration configuration, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be internal, not public.
Skip OData output formatting for non-OData routes. Improved routing action selection. Add EnableDependencyInjection() for non-OData routes.
e5754c7
to
d156f5f
Compare
Issues
This pull request makes progress on issues #975, #939, #772, #628, #229.
This pull request fixes #1170, #1171, #1172
Description
Matching parameter by name when binding ODataQueryOptions.
Skip OData output formatting for non-OData routes.
Improved routing action selection.
Add EnableDependencyInjection() for non-OData routes.
Checklist (Uncheck if it is not completed)
Additional work necessary
Refactor Batching for AspNetCore.
Port Unit Tests to NetCore
Port E2E Tests to NetCore & Xunit 2.0