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

Queries and projections #2

Open
jtheisen opened this issue Feb 13, 2019 · 0 comments
Open

Queries and projections #2

jtheisen opened this issue Feb 13, 2019 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@jtheisen
Copy link
Owner

jtheisen commented Feb 13, 2019

We need a way to load extents based on queries, ie.

    public static async Task<E[]> LoadExtentsAsync<E>(this DbContext db, IQueryable<E> query, Action<ExtentBuilder<E>> extent)
        where E : class
    {
        ...
    }

One of the tricky parts is that really we also need this to work when E isn't an entity (called a projection because the model is projected onto a class that's not part of the model). Projections are quite common.

This likely necessitates further builder related extensions as we probably need to tell Reconciler that E isn't an entity, ie. I'm not sure we can make the following syntax work:

db.LoadExtentsAsync(db.Stuff.Select(s => new { Stuff = s, More = ... }), e => e.WithOne(s => s.Stuff))

(we may have to use a method distinct from WithOne here)

@miriamblumenstein miriamblumenstein added the enhancement New feature or request label Feb 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants