I have the following scenario: there is a database that generates a new logTable every year. It began in 2001 and now has 11 tables. All of them have the same structure, therefore the same fields, indices, pk, etc.
I have several classes, called managers, which, as the name says, manage each operation in this database. For each individual table, I have a manager, with the exception of this logTable, which has only one manager.
I read and tried a lot of different things, for example, using ITable to dynamically retrieve tables or an interface that implements all my tables. Unfortunately, I am losing strongly typed properties, and with this I cannot do any searches or updates or anything else since I cannot use logTable.Where(q=> q.ID == paramId) .
Given that these tables have the same structure, a query that searches for magazines from 2010 can be accurate, which searches for magazines from 2011 onwards.
I only ask about this because I would not want to rewrite the same code for each table, since they are equal in structure.
EDIT
I am using Linq for SQL as my ORM. And these tables use all database operations, and not only.
AdrianoRR
source share