I’m using 2 databases for my project: sqlite and sql server.
I have an interface with all the needed methods but should I make 2 separate implementations for those 2 db engines?
One has:
using (IDbConnection connection = new SqlConnection(ConnectionHelper.ConnectionString))
Where the other:
using (IDbConnection connection = new SQLiteConnection(ConnectionHelper.SQLiteConnectionString))
And the rest of the code is identical. So, what is considered good practice in such situation?
On one hand there is DRY rule but on the other hand they are 2 separate repos.
I made a separate implementation but not sure how it should be handled.
Nemeles is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.