Abstract Linq method

  • Thread starter Thread starter FcabralJ
  • Start date Start date
F

FcabralJ

Guest
I have two different databases which were abstracted in Linqs through Linq4Templates: LINQA (LINQA.cs) and LINQB(LINQB.cs).They both have the same tables.

Whenever I want to use them, I need to do:




using (var dbA = new LinqA())
{
query = from a in dbA.Table1
}
using (var dbB = new LinqB())
{
query = from a in dbB.Table1
}




How could I abstract those classes in a way I call them as generic and inside they the class could know if I'm using A or B?

for instance:


using (var db = new LinqDB("dbB"))
{
query = from a in db.Table1
}

Continue reading...
 
Back
Top