protected void AndGivenAUnitOfWork() { // instance be application scope var config = DapperConfiguration .Use() .UseSqlDialect(new SqlServerDialect()); var classMapper = new CustomEntityMap <MyEntity>(); classMapper.SetIdentityGenerated(m => m.Id); var classMappers = new List <IClassMapper> { classMapper }; classMappers.Each(m => config.Register(m)); // only one supported for the time being var tranCommitPolicy = new CommitPolicyNoOp(); this._unitOfWork = new UnitOfWorkLinq <MyEntity, int>( session => new RepositoryLinq <MyEntity, int>(session), new SessionFactory(_conString, config), tranCommitPolicy); }
static UnitOfWorkManagesTransactionsStoryBase() { // can only be configured once per entity _config = DapperConfiguration .Use() .UseSqlDialect(new SqlServerDialect()); var classMapper = new CustomEntityMap <TestEntity>(); classMapper.SetIdentityGenerated(m => m.Id); var classMappers = new List <IClassMapper> { classMapper }; classMappers.Each(n => _config.Register(n)); }
protected void AndGivenADapperConfiguration() { // instance be application scope _config = DapperConfiguration .Use() .UseSqlDialect(new SqlServerDialect()); var classMapper = new CustomEntityMap <MyEntity>(); classMapper.SetIdentityGenerated(m => m.Id); var classMappers = new List <IClassMapper> { classMapper }; classMappers.Each(n => _config.Register(n)); }