This file contains hidden or 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
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) |
This file contains hidden or 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(SQLiteConfiguration.Standard.InMemory()) | |
.ShowSql()) | |
.Mappings(m => m.FluentMappings.AddFromAssemblyOf<AdjecentType>()) | |
.ExposeConfiguration(cfg => | |
{ | |
var schemaExport = new SchemaExport(cfg); | |
schemaExport.Execute(true, true, false); | |
}) | |
.BuildSessionFactory(); |
This file contains hidden or 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(@"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); | |
}) |