Skip to content

Instantly share code, notes, and snippets.

@bernardobrezende
Created December 12, 2011 14:29
Show Gist options
  • Save bernardobrezende/1467471 to your computer and use it in GitHub Desktop.
Save bernardobrezende/1467471 to your computer and use it in GitHub Desktop.
Creating SessionFactory ignoring specific property.
var sessionFactory = Fluently
.Configure()
.Database(MsSqlConfiguration.MsSql2008.ConnectionString(c => c.FromConnectionStringWithKey("MyConnString")))
.Mappings(x => x.AutoMappings.Add(AutoMap.AssemblyOf<MyEntity>(mapConfig)
.OverrideAll(ign => ign.IgnoreProperty("MyPropertyToBeIgnored"))
))
.ExposeConfiguration(cfg => new SchemaUpdate(cfg).Execute(false, true))
.BuildSessionFactory();
return sessionFactory;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment