Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Selector not working #207

Copy link
Copy link
@neman

Description

@neman
Issue body actions

I'm using EFCoreRepository

I tried selector with GetAll and FindAll, but it seems that it does not work. It always creates SQL query with all columns, instead of selector specific columns.
Even simple example like this
var test = GetAll(x=>x.Id)

or

var test = FindAll(selector: selector=>selector.Id)

query all columns, instead of just Id column value.
Looks like selector is selecting from memory, and not from database. Is this true?

How can I make projections with SharpRepository so that my generated sql query contains only selected columns?

Did I skip some configuration steps?

EDIT

I did some investigation. It seems that this commit broke the functionality c082ae65#diff-d24380b902ea13a619155432be3b7b18L289
Select is now IEnumerable, instead of IQueryable

Current code
image

Previuos code

image

Why is this query Compiled?
https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/ef/language-reference/compiled-queries-linq-to-entities

I think this should be used https://cmatskas.com/improve-ef-core-performance-with-compiled-queries/

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.