Skip to content

Implement RecordSet index for fast rows access #6

@VitaliyMF

Description

@VitaliyMF

In some cases it is useful to have fast access to in-memory rows represented by RecordSet structure (for example, for getting rows by ID values - like Legacy DataRowCollection.Find method).

I think RecordSet should remain as simple as possible (it should not become a monster like DataTable) and it internally should not handle any indexed access. Instead of that, separate class (RecordSetIndex) may incapsulate this functionality; it may accept list of columns for indexed access (may be used not only for primary key):

RecordSet rs;
var rsIdIndex = new RecordSetIndex(rs, "id");
var someRow = rsInIndex[5].FirstOrDefault();

RecordSetIndex should have .Refresh() method to rebuild index in case if RecordSet is changed.

Metadata

Metadata

Assignees

No one assigned

    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