Skip to content
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

Improve APIs for IEdmModel look ups and traversal #3147

Open
habbes opened this issue Dec 10, 2024 · 2 comments
Open

Improve APIs for IEdmModel look ups and traversal #3147

habbes opened this issue Dec 10, 2024 · 2 comments
Assignees

Comments

@habbes
Copy link
Contributor

habbes commented Dec 10, 2024

The model provides a lot of APIs for traversing and querying elements in the model. However, a lot of this APIs are insufficient or limited, leading to expensive lookup operations.

Here are example of things that are difficult to do and lead to inefficient traversals

  • Finding all properties in a model, or finding properties that meet a certain criteria. Currently, to find properties, you need to go through the collection of entity and complex types, e.g. model.SchemaElements.OfType<IEdmStructuredType()>().SelectMany(t => t.DeclaredProperties)
  • Finding a type or property using a span (to avoid substring allocations) related: 2801
  • Finding a type or property by name, using case-insensitive or custom comparer. In the past, we have resorted to reading all elements that need to be looked up and caching them in a separate dictionary with case-insensitive comparer, see: Create cache to speed up case-insensitive look up of schema elements #2610
  • etc.

Assemblies affected

Microsoft.OData.Edm 8.x

@corranrogue9
Copy link
Contributor

Let's create an ADO item to track this and split the work between breaking and non-breaking. Let's call non-breaking p2 items and breaking p3 for the next major version rev, with the planning and design for breaking as p2.

@corranrogue9
Copy link
Contributor

@habbes to follow up with David and create the ADO item

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants