I have two similar tables:
Table1:
[ id ] | [ name ]
Table2:
[ id ] | [ name ]
and I need to read/write data using only one class:
public class TwinTable
{
public virtual int Id { get; set; }
public virtual string Name1 { get; set; }
public virtual string Name2 { get; set; }
}
Plus one of the tables may or may not have an entity with the specified Id, and both tables may or may not have entities, so Name1 can be null and Name2 can be null and both of them can be null.
I can not change the structure of the DB, and it's not a good thing if i have to add something to it.
Hope for your help!