Skip to content

Instantly share code, notes, and snippets.

Jan Daniel Anderse jand187

Block or report user

Report or block jand187

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jand187
jand187 / Generic builder with extensions
Last active Apr 5, 2019
Generic builder with extensions
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)
@jand187
jand187 / gist:4537031
Last active Dec 11, 2015
Basic setup for Fluent NHibernate SQLite.InMemory
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();
@jand187
jand187 / gist:4537021
Created Jan 15, 2013
Basic setup for Fluent NHibernate SQL-Server
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);
})
You can’t perform that action at this time.