https://github.com/haritha99ch/extendedspecificationpattern-example
Showcases an extended specification pattern with projection capability.
https://github.com/haritha99ch/extendedspecificationpattern-example
aggregate-root clean-architecture domain-driven-design dotnet entity-framework-core generic-repository mssql specification-pattern user-secrets
Last synced: 11 months ago
JSON representation
Showcases an extended specification pattern with projection capability.
- Host: GitHub
- URL: https://github.com/haritha99ch/extendedspecificationpattern-example
- Owner: haritha99ch
- License: mit
- Created: 2024-04-21T09:09:58.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-21T09:11:16.000Z (almost 2 years ago)
- Last Synced: 2025-01-09T06:53:16.819Z (about 1 year ago)
- Topics: aggregate-root, clean-architecture, domain-driven-design, dotnet, entity-framework-core, generic-repository, mssql, specification-pattern, user-secrets
- Language: C#
- Homepage:
- Size: 36.1 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Specification Pattern In .NET With Projection.
This demo project showcases an extended specification pattern with projection capability, specifically tailored for Entity Framework in .NET. It showcases how the specification pattern can be effectively utilized with projection or selecting during SQL query execution rather than mapping after data retrieval, this pattern is designed to handle selection/projection directly within the SQL query when implementing the repository pattern with specifications.
## Setup
### Prerequisite
1. .NET 8 installed on your computer. You can download .NET 8 from the official website ().
2. An integrated development environment (IDE) to write your code
3. Git installed on your computer.
### Initial setup
1. Clone the project.
```shell
git clone https://github.com/haritha99ch/ExtendedSpecificationPattern-Example.git
cd ExtendedSpecificationPattern-Example
```
2. Set Environment variables.
```shell
dotnet user-secrets set "SqlServerOptions:ConnectionString" CONNECTIONSTRINGS_DEFAULTCONNECTION --project ./src/ApplicationSettings/
```
3. Install all the dependencies.
```shell
dotnet restore
```
4. Build the project.
```shell
dotnet build
```
5. Add migrations and update database.
```shell
dotnet ef migrations add InitialMigration --project ./src/Infrastructure/
dotnet ef database update --project ./src/Infrastructure/
```
> Make sure, dotnet-ef tool is installed with `dotnet tool install --global dotnet-ef`
5. Run the project.
```shell
dotnet run --project ./src/Presentation/
```