当前位置: 首页>>代码示例>>C#>>正文


C# ISqlDialect类代码示例

本文整理汇总了C#中ISqlDialect的典型用法代码示例。如果您正苦于以下问题:C# ISqlDialect类的具体用法?C# ISqlDialect怎么用?C# ISqlDialect使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ISqlDialect类属于命名空间,在下文中一共展示了ISqlDialect类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DropTableWriter

        public DropTableWriter(ISqlDialect dialect) {
            if (dialect == null) {
                throw new ArgumentNullException("dialect");
            }

            this.dialect = dialect;
        }
开发者ID:Polylytics,项目名称:dashing,代码行数:7,代码来源:DropTableWriter.cs

示例2: ToSql

        public static string ToSql(this DateTime value, ISqlDialect dialect = null)
        {
            if (value.Date == value)
                return value.ToString((dialect ?? SqlSettings.DefaultDialect).DateFormat, Invariants.DateTimeFormat);

            return value.ToString((dialect ?? SqlSettings.DefaultDialect).DateTimeFormat, Invariants.DateTimeFormat);
        }
开发者ID:CodeFork,项目名称:Serenity,代码行数:7,代码来源:SqlConversions.cs

示例3: DelimitedDbStatement

 public DelimitedDbStatement(
     ISqlDialect dialect,
     TransactionScope scope,
     IDbConnection connection,
     IDbTransaction transaction)
     : base(dialect, scope, connection, transaction)
 {}
开发者ID:jamescrowley,项目名称:NEventStore,代码行数:7,代码来源:DelimitedDbStatement.cs

示例4: InheritedSqlPersistenceEngine

 public InheritedSqlPersistenceEngine(
     IConnectionFactory connectionFactory,
     ISqlDialect dialect,
     ISerialize serializer,
     TransactionScopeOption scopeOption, int pageSize) 
     : base(connectionFactory, dialect, serializer, scopeOption, pageSize)
 {}
开发者ID:hawkins6423,项目名称:NEventStore,代码行数:7,代码来源:SqlPersistenceEngineTests.cs

示例5: ToString

 public string ToString(ISqlDialect dialect)
 {
     var sql = new StringBuilder();
     sql.AppendFormat("delete from {0}", table);
     if (where != Exp.Empty) sql.AppendFormat(" where {0}", where.ToString(dialect));
     return sql.ToString();
 }
开发者ID:haoasqui,项目名称:ONLYOFFICE-Server,代码行数:7,代码来源:SqlDelete.cs

示例6: ToSql

        public static string ToSql(this string value, ISqlDialect dialect = null)
        {
            if (value == null)
                return Null;

            return (dialect ?? SqlSettings.DefaultDialect).QuoteUnicodeString(value);
        }
开发者ID:VictorTomaili,项目名称:Sanity,代码行数:7,代码来源:SqlConversions.cs

示例7: ReverseEngineer

        public IEnumerable<IMap> ReverseEngineer(
            DatabaseSchema schema,
            ISqlDialect sqlDialect,
            IEnumerable<string> tablesToIgnore,
            IAnswerProvider answerProvider,
            bool fixOneToOnes) {
            if (tablesToIgnore == null) {
                tablesToIgnore = new string[0];
            }

            var maps = new List<IMap>();
            this.configuration = new Configuration(sqlDialect);
            foreach (var table in schema.Tables.Where(t => !tablesToIgnore.Contains(t.Name))) {
                maps.Add(this.MapTable(table));
            }

            // go back through and add indexes and foreign keys
            foreach (var map in maps) {
                GetIndexesAndForeignKeys(schema.Tables.First(t => t.Name == map.Table), map);
            }

            // go back through and try to spot one-to-one columns
            if (fixOneToOnes) {
                foreach (var map in maps) {
                    FindOneToOnes(map, answerProvider);
                }
            }

            return maps;
        }
开发者ID:Polylytics,项目名称:dashing,代码行数:30,代码来源:Engineer.cs

示例8: ToString

 public override string ToString(ISqlDialect dialect)
 {
     return string.Format("{0} {1} {2}",
                          column1.ToString(dialect),
                          Not ? "<>" : "=",
                          column2.ToString(dialect));
 }
开发者ID:vipwan,项目名称:CommunityServer,代码行数:7,代码来源:EqColumnsExp.cs

示例9: Append

        public void Append(StringBuilder stringBuilder, ISqlDialect dialect) {
            if (this.Node != null) {
                stringBuilder.Append(this.Node.Alias).Append(".");
            }

            dialect.AppendQuotedName(stringBuilder, this.columnName);
        }
开发者ID:Polylytics,项目名称:dashing,代码行数:7,代码来源:ColumnElement.cs

示例10: ForConnection

        public ICreateSessionFactory ForConnection(string connectionName, ISqlDialect sqlDialect, IDbDriver dbDriver)
        {
            if (connectionName == null)
            {
                throw new ArgumentNullException("connectionName");
            }

            if (sqlDialect == null)
            {
                throw new ArgumentNullException("sqlDialect");
            }

            if (dbDriver == null)
            {
                throw new ArgumentNullException("dbDriver");
            }

            var configSection = ConfigurationManager.ConnectionStrings[connectionName];

            if (configSection == null)
            {
                throw new ConfigurationException(ExceptionMessages.FluentConfiguration_ConnectionNotFound.FormatWith(connectionName));
            }

            this.chosenConnectionName = configSection.Name;
            this.chosenSqlDialect = sqlDialect;
            this.chosenDbDriver = dbDriver;
            this.chosenDbDriver.ConnectionString = configSection.ConnectionString;
            this.chosenDbDriver.DbProviderFactory = DbProviderFactories.GetFactory(configSection.ProviderName);

            return this;
        }
开发者ID:rubenalves,项目名称:MicroLite,代码行数:32,代码来源:FluentConfiguration.cs

示例11: Dump

        public static string Dump(string sql, IDictionary<string, object> parameters, ISqlDialect dialect = null)
        {
            if (parameters == null)
                return sql;

            var param = parameters.ToList();
            for (var i = 0; i < param.Count; i++)
            {
                var name = param[i].Key;
                if (!name.StartsWith("@"))
                    param[i] = new KeyValuePair<string,object>("@" + name, param[i].Value);
            }

            param.Sort((x, y) => y.Key.Length.CompareTo(x.Key.Length));

            var sb = new StringBuilder(sql);
            foreach (var pair in param)
                sb.Replace(pair.Key, DumpParameterValue(pair.Value, dialect));

            var text = DatabaseCaretReferences.Replace(sb.ToString());

            dialect = dialect ?? SqlSettings.DefaultDialect;
            var openBracket = dialect.OpenQuote;
            if (openBracket != '[')
                text = BracketLocator.ReplaceBrackets(text, dialect);

            var paramPrefix = dialect.ParameterPrefix;
            if (paramPrefix != '@')
                text = ParamPrefixReplacer.Replace(text, paramPrefix);

            return text;
        }
开发者ID:CodeFork,项目名称:Serenity,代码行数:32,代码来源:SqlDebugDumper.cs

示例12: SessionFactory

        internal SessionFactory(string connectionName, IDbDriver dbDriver, ISqlDialect sqlDialect)
        {
            this.connectionName = connectionName;
            this.dbDriver = dbDriver;
            this.sqlDialect = sqlDialect;

            this.sessionListeners = new SessionListeners(Listener.DeleteListeners, Listener.InsertListener, Listener.UpdateListeners);
        }
开发者ID:TrevorPilley,项目名称:MicroLite,代码行数:8,代码来源:SessionFactory.cs

示例13: DynamicSQLinqJoinExpression

 /// <summary>
 /// Creates a new DynamicSQLinqJoinExpression instance
 /// </summary>
 /// <param name="tableName">The database Table / View to Join</param>
 /// <param name="joinOperator">The JOIN operator</param>
 /// <param name="clause">The Join clause</param>
 /// <param name="parameters">Any parameter values necessary for the Join clause</param>
 public DynamicSQLinqJoinExpression(ISqlDialect dialect, string tableName, DynamicSQLinqJoinOperator joinOperator, string clause, object[] parameters)
 {
     this.Dialect = dialect;
     this.Table = tableName;
     this.JoinOperator = joinOperator;
     this.Clause = clause;
     this.Parameters = parameters;
 }
开发者ID:daywrite,项目名称:SQLinq,代码行数:15,代码来源:DynamicSQLinqJoinExpression.cs

示例14: FirebirdDbStatement

            public FirebirdDbStatement(
				ISqlDialect dialect,
				IDbConnection connection,
				IDbTransaction transaction,
				params IDisposable[] resources)
                : base(dialect, connection, transaction, resources)
            {
            }
开发者ID:JontyMC,项目名称:EventStore,代码行数:8,代码来源:FirebirdSqlDialect.cs

示例15: CustomSqlPersistenceFactory

 public CustomSqlPersistenceFactory(IConnectionFactory factory, ISerialize serializer, ISqlDialect dialect, TransactionScopeOption scopeOption, int pageSize) : base(factory, serializer, dialect, scopeOption, pageSize)
 {
     this.factory = factory;
     this.serializer = serializer;
     this.dialect = dialect;
     this.scopeOption = scopeOption;
     this.pageSize = pageSize;
 }
开发者ID:raghur,项目名称:Eventstore.Utils,代码行数:8,代码来源:CustomSqlPersistenceFactory.cs


注:本文中的ISqlDialect类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。