Skip to content

Make service layer independent of persistence framework #211

Closed
@shuebner

Description

@shuebner

I am currently writing an IEntityRepository implementation for MongoDB, for which there is no EF support.
The code for Filter and Sort is the same and PageAsync only differs in its query realization in that instead of ToListAsync() it is ToAsyncEnumerable().ToList().

To avoid code duplication for those methods I suggest adding an abstract class that handles Filter, Sort and PageAsync for all DB drivers that can provide an IQueryable<>, with an abstract method for DB-specific query realization.
That abstract class would only depend on IJsonApiContext.

Alternatively the query realization could be in its own interface for DI.

What do you think?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions