https://github.com/erenken/querypattern
EntityFramework Query Pattern
https://github.com/erenken/querypattern
entity-framework-core nuget-package query-pattern
Last synced: 11 months ago
JSON representation
EntityFramework Query Pattern
- Host: GitHub
- URL: https://github.com/erenken/querypattern
- Owner: erenken
- Created: 2023-04-13T21:59:38.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-12-31T06:13:21.000Z (about 1 year ago)
- Last Synced: 2025-02-04T16:50:46.445Z (about 1 year ago)
- Topics: entity-framework-core, nuget-package, query-pattern
- Language: C#
- Homepage:
- Size: 49.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://github.com/erenken/queryPattern/actions/workflows/build-tests.yml) [](https://github.com/erenken/queryPattern/actions/workflows/release.yml)

# myNOC.EntityFramework.Query
## Overview
This *Query Pattern* is something I got from listening to a [.NET Rocks](https://www.dotnetrocks.com/) episode #1494
[Developer Tips and Design Patterns with Steve Smith](https://www.dotnetrocks.com/details/1494). [Steve Smith](https://ardalis.com/) talks about the
*Specification Pattern* at 49:50 in the podcast, and this is what inspired this.
What Steve describes is a problem we saw in our projects. Developers would keep adding more methods to the repository or keep adding JOINs to a result
because they need this one other column added to an already returning list. This will start to overly complicate the original list. For example, you
already have a screen that shows the list of users, and if they are active or not. Now, some other screen needs the list of users and wants the security
role or permissions that user has also displayed. What happens often is someone just goes and modifies that original user list and adds this other data.
So, where you needed a simple quick list of users is now doing way more than it needs and could potentially slow down the query.
This pattern also gives you the ability to easily test your queries. As Steve points out in the podcast what might work fine in compile time,
or even within a unit test using mocked lists as your data, could give you a runtime error when running against EntityFramework.
## nuget.org
For installation instructions please to to [myNOC.EntityFramework.Query](https://www.nuget.org/packages/myNOC.EntityFramework.Query/) at [nuget.org](https://nuget.org).
## Documentation & Usage
The documentation for the library can be found [here](./src/myNOC.EntityFramework.Query/README.md)
A very simple sample project [here](./sample/QuerySample/),