Beispiel #1
0
        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));
        }
Beispiel #2
0
        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));
        }