Created
December 12, 2011 14:29
-
-
Save bernardobrezende/1467471 to your computer and use it in GitHub Desktop.
Creating SessionFactory ignoring specific property.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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