Comments on: Using Multiple Databases in ASP.NET Core via Entity Framework Core https://code-maze.com/aspnetcore-multiple-databases-efcore/ Learn. Code. Succeed. Mon, 27 May 2024 19:09:09 +0000 hourly 1 https://wordpress.org/?v=6.7.5 By: Marinko Spasojević https://code-maze.com/aspnetcore-multiple-databases-efcore/#comment-7397 Thu, 19 Jan 2023 07:56:46 +0000 https://code-maze.com/?p=60348#comment-7397 In reply to Antonio Junior.

You are most welcome.

]]>
By: Antonio Junior https://code-maze.com/aspnetcore-multiple-databases-efcore/#comment-7395 Wed, 18 Jan 2023 19:04:26 +0000 https://code-maze.com/?p=60348#comment-7395 Thank you for this article! Helpfuly.

]]>
By: John parker https://code-maze.com/aspnetcore-multiple-databases-efcore/#comment-6787 Wed, 19 Oct 2022 17:31:14 +0000 https://code-maze.com/?p=60348#comment-6787 In reply to MarinkoSpasojevic.

Thank you I’ll take a look.

John

]]>
By: MarinkoSpasojevic https://code-maze.com/aspnetcore-multiple-databases-efcore/#comment-6786 Wed, 19 Oct 2022 15:25:29 +0000 https://code-maze.com/?p=60348#comment-6786 In reply to John parker.

Well maybe it could, but in the case you described, the client is working with a single database it is just matter of which db you assign to that client once they are logged in. We have an article on multitenant applications, just search for it in the search input field. Maybe that one can help you even more.

]]>
By: John parker https://code-maze.com/aspnetcore-multiple-databases-efcore/#comment-6784 Wed, 19 Oct 2022 14:28:56 +0000 https://code-maze.com/?p=60348#comment-6784 I have a unique situation I have a client who has 4 databases, all the database have the same schema but different data. At login my client want to select the data source they want to work with. This pattern looks like it will work for me. Any thoughts?

]]>
By: gerik https://code-maze.com/aspnetcore-multiple-databases-efcore/#comment-5174 Mon, 28 Feb 2022 06:02:48 +0000 https://code-maze.com/?p=60348#comment-5174 In reply to MarinkoSpasojevic.

thank you

]]>
By: MarinkoSpasojevic https://code-maze.com/aspnetcore-multiple-databases-efcore/#comment-5164 Fri, 25 Feb 2022 11:27:16 +0000 https://code-maze.com/?p=60348#comment-5164 In reply to gerik.

Well, without going too much into why you have this db structure, and why this is not just a single table, I must say that I don’t understand why you have master and slave DBs where you just read data from one db and modify data in another db. When you do update, you have to read the data, assign changes, and then execute the modification in db, for me, it just doesn’t make sense to have two DBs. That means, if you delete the data from the master table, you should do it in the child because both have the same data… This is just redundant. I never worked with such a db structure and to be honest, I have no idea what is the proper way of handling that.

]]>
By: gerik https://code-maze.com/aspnetcore-multiple-databases-efcore/#comment-5163 Fri, 25 Feb 2022 07:09:53 +0000 https://code-maze.com/?p=60348#comment-5163 In reply to Marinko Spasojević.

thank you, but when I read data from slave/readonly (for example table x and record with id 5) database and than for some reason I want to update this record, (update must happened in master) how can I handle this? I must read record again from master(table x with id 5) and than update?(probably no )

]]>
By: Marinko Spasojević https://code-maze.com/aspnetcore-multiple-databases-efcore/#comment-5162 Fri, 25 Feb 2022 06:51:05 +0000 https://code-maze.com/?p=60348#comment-5162 In reply to gerik.

Well, we don’t have anything that specific. But, since your repository user classes (in this article CompanyRepository and ClientRepository) communicate with DBs, just separate the logic. Ones that have an interaction with the master db shouldn’t handle read operations and vice versa.

]]>
By: gerik https://code-maze.com/aspnetcore-multiple-databases-efcore/#comment-5161 Thu, 24 Feb 2022 19:10:17 +0000 https://code-maze.com/?p=60348#comment-5161 I made replica on sql server, now i have master and slave database, i wont use master only write and slave for only read, do you have any article with helps me to implement it in repository pattern?

]]>