本文整理汇总了C#中System.Data.Linq.Provider.NodeTypes.SqlExpression类的典型用法代码示例。如果您正苦于以下问题:C# SqlExpression类的具体用法?C# SqlExpression怎么用?C# SqlExpression使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SqlExpression类属于System.Data.Linq.Provider.NodeTypes命名空间,在下文中一共展示了SqlExpression类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: SqlJoin
internal SqlJoin(SqlJoinType type, SqlSource left, SqlSource right, SqlExpression cond, Expression sourceExpression)
: base(SqlNodeType.Join, sourceExpression) {
this.JoinType = type;
this.Left = left;
this.Right = right;
this.Condition = cond;
}
开发者ID:modulexcite,项目名称:LinqToSQL2,代码行数:7,代码来源:SqlJoin.cs
示例2: SqlMemberAssign
internal SqlMemberAssign(MemberInfo member, SqlExpression expr)
: base(SqlNodeType.MemberAssign, expr.SourceExpression) {
if (member == null)
throw Error.ArgumentNull("member");
this.member = member;
this.Expression = expr;
}
开发者ID:modulexcite,项目名称:LinqToSQL2,代码行数:7,代码来源:SqlMemberAssign.cs
示例3: SqlUnary
internal SqlUnary(SqlNodeType nt, Type clrType, ProviderType sqlType, SqlExpression expr, MethodInfo method, Expression sourceExpression)
: base(nt, clrType, sqlType, sourceExpression) {
switch (nt) {
case SqlNodeType.Not:
case SqlNodeType.Not2V:
case SqlNodeType.Negate:
case SqlNodeType.BitNot:
case SqlNodeType.IsNull:
case SqlNodeType.IsNotNull:
case SqlNodeType.Count:
case SqlNodeType.LongCount:
case SqlNodeType.Max:
case SqlNodeType.Min:
case SqlNodeType.Sum:
case SqlNodeType.Avg:
case SqlNodeType.Stddev:
case SqlNodeType.Convert:
case SqlNodeType.ValueOf:
case SqlNodeType.Treat:
case SqlNodeType.OuterJoinedValue:
case SqlNodeType.ClrLength:
break;
default:
throw Error.UnexpectedNode(nt);
}
this.Operand = expr;
this.method = method;
}
开发者ID:modulexcite,项目名称:LinqToSQL2,代码行数:28,代码来源:SqlUnary.cs
示例4: CheckJoinCondition
private void CheckJoinCondition(SqlExpression expr)
{
switch(expr.NodeType)
{
case SqlNodeType.And:
{
SqlBinary b = (SqlBinary)expr;
CheckJoinCondition(b.Left);
CheckJoinCondition(b.Right);
break;
}
case SqlNodeType.EQ:
case SqlNodeType.EQ2V:
{
SqlBinary b = (SqlBinary)expr;
SqlColumnRef crLeft = b.Left as SqlColumnRef;
SqlColumnRef crRight = b.Right as SqlColumnRef;
if(crLeft != null && crRight != null)
{
SqlColumn cLeft = crLeft.GetRootColumn();
SqlColumn cRight = crRight.GetRootColumn();
this._map[cLeft] = cRight;
this._map[cRight] = cLeft;
}
break;
}
}
}
开发者ID:modulexcite,项目名称:LinqToSQL2,代码行数:28,代码来源:SqlColumnEqualizer.cs
示例5: SqlBinary
internal SqlBinary(SqlNodeType nt, Type clrType, ProviderType sqlType, SqlExpression left, SqlExpression right, MethodInfo method)
: base(nt, clrType, sqlType, right.SourceExpression) {
switch (nt) {
case SqlNodeType.Add:
case SqlNodeType.Sub:
case SqlNodeType.Mul:
case SqlNodeType.Div:
case SqlNodeType.Mod:
case SqlNodeType.BitAnd:
case SqlNodeType.BitOr:
case SqlNodeType.BitXor:
case SqlNodeType.And:
case SqlNodeType.Or:
case SqlNodeType.GE:
case SqlNodeType.GT:
case SqlNodeType.LE:
case SqlNodeType.LT:
case SqlNodeType.EQ:
case SqlNodeType.NE:
case SqlNodeType.EQ2V:
case SqlNodeType.NE2V:
case SqlNodeType.Concat:
case SqlNodeType.Coalesce:
break;
default:
throw Error.UnexpectedNode(nt);
}
this.Left = left;
this.Right = right;
this.method = method;
}
开发者ID:modulexcite,项目名称:LinqToSQL2,代码行数:31,代码来源:SqlBinary.cs
示例6: SqlGrouping
internal SqlGrouping(Type clrType, ProviderType sqlType, SqlExpression key, SqlExpression group, Expression sourceExpression)
: base(SqlNodeType.Grouping, clrType, sqlType, sourceExpression) {
if (key == null) throw Error.ArgumentNull("key");
if (group == null) throw Error.ArgumentNull("group");
this.key = key;
this.group = group;
}
开发者ID:modulexcite,项目名称:LinqToSQL2,代码行数:7,代码来源:SqlGrouping.cs
示例7: SqlWhen
internal SqlWhen(SqlExpression match, SqlExpression value) {
// 'match' may be null when this when represents the ELSE condition.
if (value == null)
throw Error.ArgumentNull("value");
this.Match = match;
this.Value = value;
}
开发者ID:modulexcite,项目名称:LinqToSQL2,代码行数:7,代码来源:SqlWhen.cs
示例8: AddTimeSpan
internal override SqlExpression AddTimeSpan(SqlExpression dateTime, SqlExpression timeSpan, bool asNullable)
{
Debug.Assert(this.IsHighPrecisionDateTimeType(timeSpan));
SqlExpression ns = FunctionCallDatePart("NANOSECOND", timeSpan);
SqlExpression ms = FunctionCallDatePart("MILLISECOND", timeSpan);
SqlExpression ss = FunctionCallDatePart("SECOND", timeSpan);
SqlExpression mi = FunctionCallDatePart("MINUTE", timeSpan);
SqlExpression hh = FunctionCallDatePart("HOUR", timeSpan);
SqlExpression result = dateTime;
if(this.IsHighPrecisionDateTimeType(dateTime))
{
result = FunctionCallDateAdd("NANOSECOND", ns, result, dateTime.SourceExpression, asNullable);
}
else
{
result = FunctionCallDateAdd("MILLISECOND", ms, result, dateTime.SourceExpression, asNullable);
}
result = FunctionCallDateAdd("SECOND", ss, result, dateTime.SourceExpression, asNullable);
result = FunctionCallDateAdd("MINUTE", mi, result, dateTime.SourceExpression, asNullable);
result = FunctionCallDateAdd("HOUR", hh, result, dateTime.SourceExpression, asNullable);
if(this.IsDateTimeOffsetType(dateTime))
return ConvertTo(typeof(DateTimeOffset), result);
return result;
}
开发者ID:modulexcite,项目名称:LinqToSQL2,代码行数:28,代码来源:SqlFactory.cs
示例9: SqlUserQuery
internal SqlUserQuery(string queryText, SqlExpression projection, IEnumerable<SqlExpression> args, Expression source)
: base(SqlNodeType.UserQuery, source) {
this.queryText = queryText;
this.Projection = projection;
this.args = (args != null) ? new List<SqlExpression>(args) : new List<SqlExpression>();
this.columns = new List<SqlUserColumn>();
}
开发者ID:modulexcite,项目名称:LinqToSQL2,代码行数:7,代码来源:SqlUserQuery.cs
示例10: Visit
internal override SqlNode Visit(SqlNode node) {
if (node == null)
return null;
sourceExpression = node as SqlExpression;
if (sourceExpression != null) {
Type type = sourceExpression.ClrType;
UnwrapStack unwrap = this.UnwrapSequences;
while (unwrap != null) {
if (unwrap.Unwrap) {
type = TypeSystem.GetElementType(type);
}
unwrap = unwrap.Last;
}
sourceType = type;
}
if (sourceType != null && TypeSystem.GetNonNullableType(sourceType).IsValueType) {
return node; // Value types can't also have a dynamic type.
}
if (sourceType != null && TypeSystem.HasIEnumerable(sourceType)) {
return node; // Sequences can't be polymorphic.
}
switch (node.NodeType) {
case SqlNodeType.ScalarSubSelect:
case SqlNodeType.Multiset:
case SqlNodeType.Element:
case SqlNodeType.SearchedCase:
case SqlNodeType.ClientCase:
case SqlNodeType.SimpleCase:
case SqlNodeType.Member:
case SqlNodeType.DiscriminatedType:
case SqlNodeType.New:
case SqlNodeType.FunctionCall:
case SqlNodeType.MethodCall:
case SqlNodeType.Convert: // Object identity does not survive convert. It does survive Cast.
// Dig no further.
return node;
case SqlNodeType.TypeCase:
sourceType = ((SqlTypeCase)node).RowType.Type;
return node;
case SqlNodeType.Link:
sourceType = ((SqlLink)node).RowType.Type;
return node;
case SqlNodeType.Table:
sourceType = ((SqlTable)node).RowType.Type;
return node;
case SqlNodeType.Value:
SqlValue val = (SqlValue)node;
if (val.Value != null) {
// In some cases the ClrType of a Value node may
// differ from the actual runtime type of the value.
// Therefore, we ensure here that the correct type is set.
sourceType = val.Value.GetType();
}
return node;
}
return base.Visit(node);
}
开发者ID:modulexcite,项目名称:LinqToSQL2,代码行数:59,代码来源:TypeSource.cs
示例11: GetLiteralValue
private SqlValue GetLiteralValue(SqlExpression expr)
{
while(expr != null && expr.NodeType == SqlNodeType.ColumnRef)
{
expr = ((SqlColumnRef)expr).Column.Expression;
}
return expr as SqlValue;
}
开发者ID:modulexcite,项目名称:LinqToSQL2,代码行数:8,代码来源:SqlValueDeflator.cs
示例12: AddFactory
internal void AddFactory(Type elementType, Type dataReaderType, object mapping, DataLoadOptions options, SqlExpression projection, IObjectReaderFactory factory)
{
this.list.AddFirst(new LinkedListNode<CacheInfo>(new CacheInfo(elementType, dataReaderType, mapping, options, projection, factory)));
if(this.list.Count > this.maxCacheSize)
{
this.list.RemoveLast();
}
}
开发者ID:modulexcite,项目名称:LinqToSQL2,代码行数:8,代码来源:ObjectReaderFactoryCache.cs
示例13: CacheInfo
public CacheInfo(Type elementType, Type dataReaderType, object mapping, DataLoadOptions options, SqlExpression projection, IObjectReaderFactory factory)
{
this.elementType = elementType;
this.dataReaderType = dataReaderType;
this.options = options;
this.mapping = mapping;
this.projection = projection;
this.factory = factory;
}
开发者ID:modulexcite,项目名称:LinqToSQL2,代码行数:9,代码来源:ObjectReaderFactoryCache.cs
示例14: SqlClientCase
internal SqlClientCase(Type clrType, SqlExpression expr, IEnumerable<SqlClientWhen> whens, Expression sourceExpression)
: base(SqlNodeType.ClientCase, clrType, sourceExpression) {
this.Expression = expr;
if (whens == null)
throw Error.ArgumentNull("whens");
this.whens.AddRange(whens);
if (this.whens.Count == 0)
throw Error.ArgumentOutOfRange("whens");
}
开发者ID:modulexcite,项目名称:LinqToSQL2,代码行数:9,代码来源:SqlClientCase.cs
示例15: SqlSelect
internal SqlSelect(SqlExpression selection, SqlSource from, Expression sourceExpression)
: base(SqlNodeType.Select, sourceExpression) {
this.Row = new SqlRow(sourceExpression);
this.Selection = selection;
this.From = from;
this.groupBy = new List<SqlExpression>();
this.orderBy = new List<SqlOrderExpression>();
this.orderingType = SqlOrderingType.Default;
}
开发者ID:modulexcite,项目名称:LinqToSQL2,代码行数:9,代码来源:SqlSelect.cs
示例16: SqlSearchedCase
internal SqlSearchedCase(Type clrType, IEnumerable<SqlWhen> whens, SqlExpression @else, Expression sourceExpression)
: base(SqlNodeType.SearchedCase, clrType, sourceExpression)
{
if(whens == null)
throw Error.ArgumentNull("whens");
this.whens = new List<SqlWhen>(whens);
if(this.whens.Count == 0)
throw Error.ArgumentOutOfRange("whens");
this.Else = @else;
}
开发者ID:modulexcite,项目名称:LinqToSQL2,代码行数:10,代码来源:SqlSearchedCase.cs
示例17: SqlMethodCall
internal SqlMethodCall(Type clrType, ProviderType sqlType, MethodInfo method, SqlExpression obj, IEnumerable<SqlExpression> args, Expression sourceExpression)
: base(SqlNodeType.MethodCall, clrType, sqlType, sourceExpression) {
if (method == null)
throw Error.ArgumentNull("method");
this.method = method;
this.Object = obj;
this.arguments = new List<SqlExpression>();
if (args != null)
this.arguments.AddRange(args);
}
开发者ID:modulexcite,项目名称:LinqToSQL2,代码行数:10,代码来源:SqlMethodCall.cs
示例18: SqlLike
internal SqlLike(Type clrType, ProviderType sqlType, SqlExpression expr, SqlExpression pattern, SqlExpression escape, Expression source)
: base(SqlNodeType.Like, clrType, sqlType, source) {
if (expr == null)
throw Error.ArgumentNull("expr");
if (pattern == null)
throw Error.ArgumentNull("pattern");
this.Expression = expr;
this.Pattern = pattern;
this.Escape = escape;
}
开发者ID:modulexcite,项目名称:LinqToSQL2,代码行数:10,代码来源:SqlLike.cs
示例19: MakeFlattenedColumn
private SqlColumnRef MakeFlattenedColumn(SqlExpression expr, string name)
{
SqlColumn c = (!this.isInput) ? this.FindColumnWithExpression(this.row.Columns, expr) : null;
if(c == null)
{
c = new SqlColumn(expr.ClrType, expr.SqlType, name, null, expr, expr.SourceExpression);
this.row.Columns.Add(c);
}
return new SqlColumnRef(c);
}
开发者ID:modulexcite,项目名称:LinqToSQL2,代码行数:10,代码来源:SelectionFlattener.cs
示例20: SqlDiscriminatedType
internal SqlDiscriminatedType(ProviderType sqlType, SqlExpression discriminator, MetaType targetType, Expression sourceExpression)
: base(SqlNodeType.DiscriminatedType,
typeof(Type),
sourceExpression) {
if (discriminator == null)
throw Error.ArgumentNull("discriminator");
this.discriminator = discriminator;
this.targetType = targetType;
this.sqlType = sqlType;
}
开发者ID:modulexcite,项目名称:LinqToSQL2,代码行数:10,代码来源:SqlDiscriminatedType.cs
注:本文中的System.Data.Linq.Provider.NodeTypes.SqlExpression类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论