View Generic builder with extensions
public class GenericBuilder<TEntity> where TEntity : new()
{
private readonly List<Func<TEntity, object>> setters;
public GenericBuilder()
{
setters = new List<Func<TEntity, object>>();
}
public GenericBuilder<TEntity> With(params Func<TEntity, object>[] props)
View gist:4537031
var sessionFactory = Fluently.Configure()
.Database(SQLiteConfiguration.Standard.InMemory())
.ShowSql())
.Mappings(m => m.FluentMappings.AddFromAssemblyOf<AdjecentType>())
.ExposeConfiguration(cfg =>
{
var schemaExport = new SchemaExport(cfg);
schemaExport.Execute(true, true, false);
})
.BuildSessionFactory();
View gist:4537021
var sessionFactory = Fluently.Configure()
.Database(MsSqlConfiguration.MsSql2008
.ConnectionString(@"Data Source=.\<instance>;Initial Catalog=<database>;Integrated Security=True")
.ShowSql())
.Mappings(m => m.FluentMappings.AddFromAssemblyOf<AdjecentType>())
.ExposeConfiguration(cfg =>
{
var schemaExport = new SchemaExport(cfg);
schemaExport.Execute(true, true, false);
})