Skip to content
This repository was archived by the owner on Apr 9, 2025. It is now read-only.
This repository was archived by the owner on Apr 9, 2025. It is now read-only.

DbSet Optimization #4

@kanadaj

Description

@kanadaj

Describe the bug
The code uses IEnumerable<TItem>.Count() in OnInitialized(), which causes a full on SELECT * FROM Table then counts the resulting elements inside the materialized list. In a larger database this can cause extreme memory usage and loading times.

Expected behavior
Check if the data source is IQueryable<TItem>, and if it is, call it using the appropriate extension method on IQueryable<TItem> to result in the correct query. That said, if it's IQueryable<TItem>, might as well just set MinimumInputLength to 1 anyway.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions