Aditya Puri
Aditya Puri

Reputation: 11

Same table with different name Mapping NHibernate

I have multiple table in database with exactly same schema but different table name.

table_1 { col1, col2, col3, } . . table_2 { col1, col2, col3, }

I wanted to keep single mapping HBM file and model class. I tried creating different Naming strategy but the problem is to pass table name from Repository class and perform DB actions. Solution of this problem is much appreciated since I am new to NHibernate.

Upvotes: 0

Views: 139

Answers (1)

Mr Mush
Mr Mush

Reputation: 1538

Do you want to map these tables to the same object or different objects? Honestly, I do not think you can do it, HBM files are stored as resources in the DLL and can not be edited dynamically.

Upvotes: 1

Related Questions