How would you export NServiceBus's NHibernate Saga mappings?

73 Views Asked by At

We use the NServiceBus generated NHibernatePersistence mappings for our Sagas. I'd like to take a look at these mappings to help diagnose a problem and potentially serve as a starting point for some tweaks that we may need to make to these mappings.

With something like FluentNHibernate I could use an ExportTo method in order to dump out the generated hbm files. Is there something similar that I could use to dump out the default mappings that nservicebus is using for our sagas? Or is there some other way to go about exporting the generated mappings?

1

There are 1 best solutions below

2
Szymon Pobiega On

You can use the ScriptGenerator class as shown in this test. Combined with something like ApprovalTests, ScriptGenerator can make sure that the schema changes are always explicitly approved.