.NET CORE API with multi database connection using with design pattern.
The aim of the project is provides CRUD operations with 2 main database connection class which is generated by a factory with a desing patterns.
There are 3 type of controllers in this project:
- User Controller
- Team Controller
- Test Controller
We can describe factory pattern as there are one factory that generates the main entity/model class from implemented interface with inherited factory class as briefly. In our scenario, There are 2 main models. The one is User model and the other is Team model. The user models stored in PostgreSQL DB and Teams are stored in MongoDB. There are 2 DB context which implemented by an interface. And there are 2 factory which are inherited a abstarct factory class. In addition, these factories generate DB contexts of their own with DB settings.
The one is MongoDB settings. It has inserted to servers side as singleton injection. The other one is PostgresContext added as singleton injection. Their settings are gathered from config file of api. And using in constructor of the determined controllers.
In the middleware, system has request-reponse logger and exception handler mechanism. In addition, it has custom health check class as external utilty.
⌚️Continues to be developed.