简体   繁体   中英

ASP.NET Core Web API multi database in app

I currently work to develop POS (Point of Sales) based on ASP.NET Core and I am using Entity Framework Core.

What I need is create separate account for each institution that will be use our POS system at same time create its own database (customer database) dynamically (migration in EFC).

Finally when user (or institution) logs in, I have to verify the customer's account and link it with their database.

What is the framework that I need to get this job done?

I had a similar problem with you before, except that my software was connected to distributed database. In this case, I used the dynamic unit of work and the repository pattern. Also, to create a connection string for connect to each database, I kept them in another central database, and also in the dynamic unit of work you can create the dynamic repository of each database automatically and connect to the relevant database by receiving the connection string. You can also see the sample here , but you must to change repositroy and unit of work to generic mode.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM