Skip to content

Modify to fix issue for #2076, Containment expand problem#2083

Open
xuzhg wants to merge 369 commits into
OData:masterfrom
xuzhg:issue2076ExpandOnNavigation
Open

Modify to fix issue for #2076, Containment expand problem#2083
xuzhg wants to merge 369 commits into
OData:masterfrom
xuzhg:issue2076ExpandOnNavigation

Conversation

@xuzhg

@xuzhg xuzhg commented Mar 12, 2020

Copy link
Copy Markdown
Member

Issues

This pull request fixes issue #2076.

Description

*This fixes the issue in #2076.

  1. For the model builder, all non-containment navigation property should have a navigation property binding.
    2)ODataQueryOptionParser should know the "Path" to parse the query option.

Checklist (Uncheck if it is not completed)

  • Test cases added
  • Build and test with one-click build and test script passed

Additional work necessary

If documentation update is needed, please add "Docs Needed" label to the issue and provide details about the required document change in the issue.

xuzhg and others added 30 commits March 20, 2018 10:17
…rate is:

AspNet    : 4648 pass, 0 fail - 100% enabled, 100% pass
AspNetCore: 4123 pass, 97 fail - 91% enabled, 89% pass

This change:

1.) ModifiesEnableQuery to return a Json format similar to the HttpError format in AspNet. Many tests are expecting
    the exact json format from AspNet classic. It's a fine format not specific to any platform so I chose to
    emulate is for AspNetCore.

2.) Implements async client query pattern as the NetStandard version of the client does not support sync methods.

3.) Modifies LowerCamelCase tests to match error profile of AspNetCore for model validation failures.
to avoid having AspNetCore validate the object, which may access properties
such as SelectClause which throw if the clause is invalid.
…riPartial.Path)

to return the path port of the Uri, which escapes characters that need it.
The ODL Parser expects those characters to be escaped.

Uri.GetLeftPart(UriPartial.Path) is used in the AspNet version in this scenario as well.
…rate is:

AspNet    : 4648 pass, 0 fail - 100% enabled, 100% pass
AspNetCore: 4155 pass, 65 fail - 91% enabled, 98% pass

This change:

1.) Wrap EnableQueryAttribute and IActionFilter in a QueryFilterProvider() in the test fixture.
    This is similar to the configuration used in the product configuration extensions.

2.) Modifies the case of Json properties in TopSkipOrderByTests.cs.

3.) Implements async client query pattern in SingletonClientTest.cs.

4.) Implements CreateODataPath().
the description and the QueryFilter itself.
the EntityId. The response code is not set properly until after
ExecuteResultAsync() is completed.
key is not present in the SerializableError.

Convert the errors in SerializableError into ODataErrorDetail
collection.
xuzhg and others added 12 commits February 24, 2020 16:29
* Added support for functions and constants in aggregate expression

* Tests for more cannonical functions

* Time tests

* Support for compute transformation in $apply

* Support sorting for columns introduced in compute

* Remove redundant code

* Fix flakyness in AggregateNavigationPropertyWorks

* Fix the ToInt16 overflow during build

* Fix typos

* Make _values field private

* Explicit way to mutate element type and lambda param

* Test to demonstrate that we could run compute on complex entity properties

* Support for complex types

* Simplify keepoing ElementType and LambdaParameter in sync

Co-authored-by: Sam Xu <saxu@microsoft.com>
… dynamic controller (OData#2035)

* Enable endpoint routing using dynamic controller

* Update to 7.4.0

* Update the PublicAPI test cases

* Add the E2E test cases

* Change the startup to test the per-route configuration

* Some test codes about policy

* Use MatcherPolicy Instead of EndpointSelector to resolve the ambiguity

* Address the comments and add LinkGenerator test cases

* Revert the EF Core version to 2.2.0 to make Aggregation E2E test pass
@xuzhg xuzhg force-pushed the issue2076ExpandOnNavigation branch from 6667e20 to 7f03890 Compare March 12, 2020 05:28
@mikepizzo mikepizzo added this to the 7.5 milestone May 6, 2020
@mikepizzo mikepizzo self-requested a review September 8, 2020 23:06
@xuzhg xuzhg removed this from the 7.5 milestone Sep 14, 2020

namespace AspNetCore3xEndpointSample.Web.Controllers
{
{/*

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason to keep the commented out version?


namespace AspNetCore3xEndpointSample.Web.Models
{
{/*

@mikepizzo mikepizzo Jan 5, 2021

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this commented out? Is it no longer used? Just remove?

//public CustomerOrderContext(DbContextOptions<CustomerOrderContext> options)
// : base(options)
//{
//}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be removed?

public DbSet<Customer> Customers { get; set; }

public DbSet<Order> Orders { get; set; }
// public DbSet<Order> Orders { get; set; }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove?

builder.EntitySet<Order>("Orders");
var customers = builder.EntitySet<Customer>("Customers");
customers.Binding.HasManyPath(c => c.CustomerReferrals, true).HasRequiredBinding(r => r.ReferredCustomer, "Customers");
// builder.EntitySet<Order>("Orders");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove?

services.AddDbContext<CustomerOrderContext>(opt => opt.UseLazyLoadingProxies().UseInMemoryDatabase("CustomerOrderList"));
//services.AddDbContext<CustomerOrderContext>(opt => opt.UseLazyLoadingProxies().UseInMemoryDatabase("CustomerOrderList"));
//services.AddScoped<CustomerOrderContext>(_ => new CustomerOrderContext(Configuration.GetConnectionString("DefaultConnection")));
services.AddOData();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove commented out lines?

@mikepizzo

Copy link
Copy Markdown
Contributor

Is there a test to verify that the issue reported in issue 2076 is addressed? I see changes to the sample but no code that calls them in new ways.

@mikepizzo mikepizzo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕐

@mikepizzo

Copy link
Copy Markdown
Contributor

Hey @xuzhg --

Do you have an update on this PR? I left a few minor comments. Can we address, rebase, and merge, or are there open issues?

@xuzhg xuzhg force-pushed the master branch 2 times, most recently from 4c43a84 to ddfd3dd Compare May 29, 2026 01:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.