本文整理汇总了C#中Simple.Data.Ado.Schema.DatabaseSchema类的典型用法代码示例。如果您正苦于以下问题:C# DatabaseSchema类的具体用法?C# DatabaseSchema怎么用?C# DatabaseSchema使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DatabaseSchema类属于Simple.Data.Ado.Schema命名空间,在下文中一共展示了DatabaseSchema类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CommandBuilder
public CommandBuilder(string text, DatabaseSchema schema, int bulkIndex)
{
_text = new StringBuilder(text);
_schemaProvider = schema.SchemaProvider;
_customInterfaceProvider = schema.ProviderHelper;
_parameterSuffix = (bulkIndex >= 0) ? "_c" + bulkIndex : string.Empty;
}
示例2: OracleProcedureExecutor
public OracleProcedureExecutor(OracleConnectionProvider connectionProvider, ObjectName procedureName)
{
_connectionProvider = connectionProvider;
_schema = DatabaseSchema.Get(_connectionProvider, new ProviderHelper());
_procedureName = procedureName;
_executeImpl = ExecuteReader;
}
示例3: OnSetup
protected override void OnSetup()
{
var settingsKeys = ((IDictionary<string, object>) Settings).Keys;
if (settingsKeys.Contains("ConnectionString"))
{
if (settingsKeys.Contains("ProviderName"))
{
_connectionProvider = ProviderHelper.GetProviderByConnectionString(Settings.ConnectionString,
Settings.ProviderName);
}
else
{
_connectionProvider = ProviderHelper.GetProviderByConnectionString(Settings.ConnectionString);
}
}
else if (settingsKeys.Contains("Filename"))
{
_connectionProvider = ProviderHelper.GetProviderByFilename(Settings.Filename);
}
else if (settingsKeys.Contains("ConnectionName"))
{
_connectionProvider = ProviderHelper.GetProviderByConnectionName(Settings.ConnectionName);
}
_schema = DatabaseSchema.Get(_connectionProvider, _providerHelper);
_relatedFinder = new Lazy<AdoAdapterRelatedFinder>(CreateRelatedFinder);
_commandOptimizer = ProviderHelper.GetCustomProvider<CommandOptimizer>(_connectionProvider) ??
new CommandOptimizer();
}
示例4: AdoAdapter
internal AdoAdapter(IConnectionProvider connectionProvider) : this()
{
_connectionProvider = connectionProvider;
_schema = DatabaseSchema.Get(_connectionProvider, _providerHelper);
_relatedFinder = new Lazy<AdoAdapterRelatedFinder>(CreateRelatedFinder);
_commandOptimizer = ProviderHelper.GetCustomProvider<CommandOptimizer>(_connectionProvider) ??
new CommandOptimizer();
}
示例5: CommandBuilder
public CommandBuilder(string text, DatabaseSchema schema, IEnumerable<KeyValuePair<ParameterTemplate, Object>> parameters)
: this(text, schema, -1)
{
foreach (var kvp in parameters)
{
_parameters.Add(kvp.Key, kvp.Value);
}
}
示例6: ExpressionFormatter
public ExpressionFormatter(ICommandBuilder commandBuilder, DatabaseSchema schema)
{
_commandBuilder = commandBuilder;
_schema = schema;
_expressionFormatters = new Dictionary<SimpleExpressionType, Func<SimpleExpression, string>>
{
{SimpleExpressionType.And, LogicalExpressionToWhereClause},
{SimpleExpressionType.Or, LogicalExpressionToWhereClause},
{SimpleExpressionType.Equal, EqualExpressionToWhereClause},
{SimpleExpressionType.NotEqual, NotEqualExpressionToWhereClause},
{SimpleExpressionType.GreaterThan, expr => BinaryExpressionToWhereClause(expr, ">")},
{SimpleExpressionType.GreaterThanOrEqual, expr => BinaryExpressionToWhereClause(expr, ">=")},
{SimpleExpressionType.LessThan, expr => BinaryExpressionToWhereClause(expr, "<")},
{SimpleExpressionType.LessThanOrEqual, expr => BinaryExpressionToWhereClause(expr, "<=")},
};
}
示例7: CreateParameters
private IEnumerable<IDbDataParameter> CreateParameters(DatabaseSchema schema, IDbCommand command, IEnumerable<object> parameterValues)
{
var fixedParameters = _parameters.Where(pt => pt.Type == ParameterType.FixedValue).ToArray();
if ((!parameterValues.Any(pv => pv != null)) && fixedParameters.Length == 0) yield break;
parameterValues = parameterValues.Where(pv => pv != null);
foreach (var fixedParameter in fixedParameters)
{
yield return CreateParameter(command, fixedParameter, fixedParameter.FixedValue);
}
var columnParameters = _parameters.Where(pt => pt.Type != ParameterType.FixedValue).ToArray();
foreach (var parameter in parameterValues.Any(o => o is IEnumerable && !(o is string)) || parameterValues.Any(o => o is IRange)
? parameterValues.SelectMany((v, i) => CreateParameters(schema, command, columnParameters[i], v))
: parameterValues.Select((v, i) => CreateParameter(command, columnParameters[i], v)))
{
yield return parameter;
}
}
示例8: Joiner
public Joiner(JoinType joinType, DatabaseSchema schema)
{
if (schema == null) throw new ArgumentNullException("schema");
_joinType = joinType;
_schema = schema;
}
示例9: AdoAdapter
internal AdoAdapter(IConnectionProvider connectionProvider)
{
_connectionProvider = connectionProvider;
_schema = DatabaseSchema.Get(_connectionProvider);
_relatedFinder = new Lazy<AdoAdapterRelatedFinder>(CreateRelatedFinder);
}
示例10: ExpressionFormatter
public ExpressionFormatter(ICommandBuilder commandBuilder, DatabaseSchema schema)
{
_commandBuilder = commandBuilder;
_schema = schema;
_simpleReferenceFormatter = new SimpleReferenceFormatter(_schema, _commandBuilder);
}
示例11: FindHelper
public FindHelper(DatabaseSchema schema)
{
_schema = schema;
_commandBuilder = new CommandBuilder(schema.SchemaProvider);
_expressionFormatter = new ExpressionFormatter(_commandBuilder, _schema);
}
示例12: GetHelper
public GetHelper(DatabaseSchema schema)
{
_schema = schema;
_commandBuilder = new CommandBuilder(schema);
}
示例13: ExpressionFormatter
public ExpressionFormatter(ICommandBuilder commandBuilder, DatabaseSchema schema)
{
_commandBuilder = commandBuilder;
_schema = schema;
}
示例14: GetSchema
public DatabaseSchema GetSchema()
{
return _schema ?? (_schema = DatabaseSchema.Get(_connectionProvider, _providerHelper));
}
示例15: OnReset
protected override void OnReset()
{
DatabaseSchema.ClearCache();
_schema = DatabaseSchema.Get(_connectionProvider, _providerHelper);
}