views:

338

answers:

2

I have some existing asp.net membership and roles tables in a legacy db and I am mapping them to new entities with Fluent Nhibernate.

I also generate the schema directly from Fluent Nhibernate and I then manually tweak the generated sql script to exclude the existing tables.

Is it possible to say to Fluent Nhibernate to exclude from generation certain tables?

A: 

SchemaAction.None() in your ClassMap.

James Gregory
I see a SchemaAction enum, but where do I put in my classmap? Just inserting SchemaAction.None(); is not working.
Ronnie
A: 

Another option would be to create an attribute, say

public class DoNotAutoPersistAttribute : Attribute
{
}

Then in AutoPersistenceModelGenerator you could check for this attribute in the Where clause of AddEntityAssembly.

dove