Skip to content

AdemCatamak/SpecificationPatternExample

Repository files navigation

Specification Design Pattern

Medium üzerinde yayınlanmış bir yazıya ait örnek kodlar bu repository içerisinde yer almaktadır. Yazıya bu link aracılığı ile erişebilirsiniz: https://medium.com/@ademcatamak/specification-tasarim-deseni-d142692a8e41

This repo contains sample codes for the Medium article, which you can access via https://medium.com/@ademcatamak/specification-design-pattern-c814649be0ef.

The implementation of design pattern is in the SpecificationPatternExample.Specification project which has no dependencies. You are free to copy this project and use it.

Note: You can access the implementation of the design pattern via NuGet using the name Spectacular.

RUN

When you run the program and send some GET requests, created sql queries can be seen via console screen. The easiest way of running the program is using docker-compose up. If you want to debug the code, you have two ways which are listed below.

Way 1

The project could be executed via docker-compose. If you have an IDE which is capable of debugging docker-compose file, docker-compose.yml which is located at the main directory would be useful for you.

In case of choosing this way to run the project, you can reach swagger screen via http://localhost:10000.

Note: Because the sql server needs more time to be ready compared to SpecificationPatternExample-Api, it might take a while for you to reach the endpoints after docker-compose up command execution.

Way 2

If you want to execute the project without using docker, it is required that you set the connection strings inside the SpecificationPatternExample/appsettings.json file.

Changes to be made are:

  1. ConnectionStrings -> SqlServer value should be changed with the Sql Server connection string that you have.