I am creating a transfer data tool for the company application, to move data from the old version to the new, and back. Since now we are using NHibernate and FluentMapping, I'll have to map all old tables, and there is a problem with one table with composed primary key. The table looks like this:
public class OldTable {
public string KeyOne {get;set}
public string KeyTwo {get;set}
public string KeyN {get;set}
public int Sequence {get;set}
...
}
And I need to map all the above fields as a composite key, the only problem is that "Sequence" increments based on the other fields to avoid duplicated keys, the others are a mix of foreign keys and simple strings. Is there a way to do this mapping? If it takes creating a expression to calculate the Sequence, no problem.
The good news is the table in the new system just uses a integer Id.