-3
I am creating an ASP.NET MVC application with Code First. This system is trade management software. I’d like to separate the information from each company, not leave it all in the same bank. We initially thought about leaving everything the same, but we thought about the performance issue. The bank would grow big, and it would take time to perform some things.
I thought about creating the bank for the first login of that company, and then with the logged-in user he could register the other users. He would be like the "Master" of the company. Then the other users he registers would go to a bank of Logins
where it would have a field that identified the company of that user, and accessed the bank of the same. I would only create the bank for the first user of the company.
This is possible?
Welcome to theOpt. What you have tried to do?
– user28595
I haven’t found anything on the Internet yet. I was able to use "Database.Createifnotexist()" in the Context of my database to automatically create when running my application. But it only creates the database present in my Web.Config. I know that for Desktop, it is possible to change the App.Config and connect me to a different bank. But I don’t know how to do this on MVC, or how to create different banks at runtime.
– Davi GN
Why create a bank, not a table? I couldn’t see the need to create a bank for each user.
– user28595
This system is a trade management software, I would like to separate the information of each company, and not leave everything in the same bank. We initially thought about leaving everything the same, but we thought about the performance issue. The bank would grow a lot, and it would take time to perform some things. As I should do in this case?
– Davi GN
The approach I use is to keep everything in the same bank and create a 'Company' entity where you can register the head office and subsidiaries. Think of the following situation: an affiliate may have more than one user. In that case you would actually create a bank for each user?
– Pedro Teles
I thought about creating the bank for the first login of that company, and then with the logged-in user he could register the other users. He’d be like the "Master" of the company. Then the other users that he registered would go to a Logins database where he would have a field that identified that user’s company, and accessed the user’s bank. I would only create the bank for the first user of the company, you know?
– Davi GN