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

AutoMapper/AutoQueryable/EntityFramework select filtering #80

Open
tomkurian01 opened this issue Feb 5, 2019 · 0 comments
Open

AutoMapper/AutoQueryable/EntityFramework select filtering #80

tomkurian01 opened this issue Feb 5, 2019 · 0 comments

Comments

@tomkurian01
Copy link

Currently I have something that looks like this in my Get Controller API. (I'm using Entity Framework 6, Automapper 7)

_ctx.Person.UseAsDataSource(mapper).For();

But what happens in the database is that it does a select on each column in the table even if only ask for a couple of items from the URI. I was wondering if there is an optimal way to do this so that only the items that are selected in the URI are selected on in the table:

So for example if I did a URI like this: http//localhost/api/v1/person?select=id,firstname

I would get a query like select [Extent1].id, [Extent1].firstname from Person as [Extent1]

Currently the query looks like this:
select [Extent1].id, [Extent1].firstname, [Extent1].lastname, [Extent1].middlename, etc. from
Person as [Extent1]

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

No branches or pull requests

1 participant