示例#1
0
        public static void SetDialogueIfNeeded_AddsMappedIsFroozenToDictionary()
        {
            var target = new SqlDialectHelper();

            target.SetDialogueIfNeeded <Brave>(SqlDialect.SqLite);
            var result = target.GetEntityState <Brave>();

            Assert.That(result.HasValue, Is.True);
            Assert.That(OrmConfiguration.GetDefaultEntityMapping <Brave>().Dialect, Is.EqualTo(SqlDialect.SqLite));
        }
示例#2
0
 protected void SetDialogueOnce <T>(IUnitOfWork uow) where T : class
 {
     _helper.SetDialogueIfNeeded <T>(uow.SqlDialect);
 }
示例#3
0
 public static int BulkDelete <TEntity>(this IUnitOfWork uow,
                                        Action <IConditionalBulkSqlStatementOptionsBuilder <TEntity> > statementOptions = null) where TEntity : class
 {
     DialogueHelper.SetDialogueIfNeeded <TEntity>(uow.SqlDialect);
     return(statementOptions != null?
            uow.Connection.BulkDelete(statementOptions) :
                uow.Connection.BulkDelete <TEntity>(statement => statement.AttachToTransaction(uow.Transaction)));
 }
 public static int BulkDelete <TEntity>(this ISession connection,
                                        Action <IConditionalBulkSqlStatementOptionsBuilder <TEntity> > statementOptions = null) where TEntity : class
 {
     DialogueHelper.SetDialogueIfNeeded <TEntity>(connection.SqlDialect);
     return((connection as IDbConnection).BulkDelete(statementOptions));
 }