Skip to content

Instantly share code, notes, and snippets.

@orjan
Created September 8, 2009 20:32
Show Gist options
  • Save orjan/183204 to your computer and use it in GitHub Desktop.
Save orjan/183204 to your computer and use it in GitHub Desktop.
NH fluent configuration
ISessionFactory sessionFactory = Fluently.Configure()
.Database(SQLiteConfiguration.Standard.InMemory)
.Mappings(m => m.AutoMappings.Add(
AutoMap.AssemblyOf<Entity>()
//.IncludeBase<Entity>()
.Where(t => t.Namespace.EndsWith("Domain"))
.IgnoreBase<Entity>()
//.Conventions.Add<MyStringLengthConvention>()
.Conventions.Add<MyIdConvention>()
))
.ExposeConfiguration(BuildSchema)
.BuildSessionFactory();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment