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.
- .NET 8 installed on your computer. You can download .NET 8 from the official website (https://dotnet.microsoft.com/download/dotnet/8.0).
- An integrated development environment (IDE) to write your code
- Git installed on your computer.
- Clone the project.
git clone https://github.com/haritha99ch/ExtendedSpecificationPattern-Example.git
cd ExtendedSpecificationPattern-Example
- Set Environment variables.
dotnet user-secrets set "SqlServerOptions:ConnectionString" CONNECTIONSTRINGS_DEFAULTCONNECTION --project ./src/ApplicationSettings/
-
Install all the dependencies.
dotnet restore
-
Build the project.
dotnet build
- Add migrations and update database.
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
- Run the project.
dotnet run --project ./src/Presentation/