Title: Selector not working · Issue #207 · SharpRepository/SharpRepository · GitHub
Open Graph Title: Selector not working · Issue #207 · SharpRepository/SharpRepository
X Title: Selector not working · Issue #207 · SharpRepository/SharpRepository
Description: 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(...
Open Graph Description: 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 sim...
X Description: 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...
Opengraph URL: https://github.com/SharpRepository/SharpRepository/issues/207
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Selector not working","articleBody":"I'm using EFCoreRepository\r\n\r\nI 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.\r\nEven simple example like this\r\n`var test = GetAll(x=\u003ex.Id)`\r\n\r\nor\r\n\r\n`var test = FindAll(selector: selector=\u003eselector.Id)`\r\n\r\nquery all columns, instead of just Id column value.\r\nLooks like selector is selecting from memory, and not from database. Is this true?\r\n\r\nHow can I make projections with SharpRepository so that my generated sql query contains only selected columns?\r\n\r\n\r\nDid I skip some configuration steps?\r\n\r\n## **EDIT**\r\n\r\nI did some investigation. It seems that this commit broke the functionality https://github.com/SharpRepository/SharpRepository/commit/c082ae65#diff-d24380b902ea13a619155432be3b7b18L289\r\nSelect is now IEnumerable, instead of IQueryable\r\n\r\nCurrent code\r\n\r\n\r\nPreviuos code\r\n\r\n\r\n\r\nWhy is this query Compiled?\r\nhttps://docs.microsoft.com/en-us/dotnet/framework/data/adonet/ef/language-reference/compiled-queries-linq-to-entities\r\n\r\nI think this should be used https://cmatskas.com/improve-ef-core-performance-with-compiled-queries/","author":{"url":"https://github.com/neman","@type":"Person","name":"neman"},"datePublished":"2018-05-22T14:42:22.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":16},"url":"https://github.com/207/SharpRepository/issues/207"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:f4c04534-8edd-f99b-888d-34652324a347 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 982E:3EFEAF:316EE1F:427F5A8:6973012E |
| html-safe-nonce | c194b5632a843a45e80d3a130bf00e7e70b288284a20b8a6093e541a3a5f64a6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5ODJFOjNFRkVBRjozMTZFRTFGOjQyN0Y1QTg6Njk3MzAxMkUiLCJ2aXNpdG9yX2lkIjoiNzA1NTM2MDU2ODY2Mjg4NDY1NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | c51dc8a1bd63785e3479c6118957e29c5129fac781e79ca93da9ffed59acae7a |
| hovercard-subject-tag | issue:325326440 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/SharpRepository/SharpRepository/207/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ef57aefeec6b708c70d5fc240c7c6d7d45c337651a765b30eb1713e9f1fb7e2d/SharpRepository/SharpRepository/issues/207 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ef57aefeec6b708c70d5fc240c7c6d7d45c337651a765b30eb1713e9f1fb7e2d/SharpRepository/SharpRepository/issues/207 |
| og:image:alt | 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 sim... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | neman |
| hostname | github.com |
| expected-hostname | github.com |
| None | 44ab3188c1dcfe3be0f9c3feca2e04e14fb79f120939ce2395e4f15ab96ec1d4 |
| turbo-cache-control | no-preview |
| go-import | github.com/SharpRepository/SharpRepository git https://github.com/SharpRepository/SharpRepository.git |
| octolytics-dimension-user_id | 1801360 |
| octolytics-dimension-user_login | SharpRepository |
| octolytics-dimension-repository_id | 4514047 |
| octolytics-dimension-repository_nwo | SharpRepository/SharpRepository |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 4514047 |
| octolytics-dimension-repository_network_root_nwo | SharpRepository/SharpRepository |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | a5e2b48bd1260476599758f5d253b5d24092ab84 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width