コード例 #1
0
ファイル: LinqCommand.cs プロジェクト: yuanfei05/vita
        public EntityInfo TargetEntity; //for delete, insert, update

        #endregion Fields

        #region Constructors

        public LinqCommand(EntityQuery query, LinqCommandType commandType, LinqCommandKind kind, EntityInfo targetEntity)
        {
            Kind = kind;
              CommandType = commandType;
              Query = query;
              TargetEntity = targetEntity;
        }
コード例 #2
0
ファイル: LinqCommands.cs プロジェクト: radtek/vita
 public DynamicLinqCommand(EntitySession session, Expression queryExpression, LinqCommandKind kind = LinqCommandKind.Dynamic,
                           LinqOperation op = LinqOperation.Select, EntityInfo updateEntity = null)
     : base(session, kind, op)
 {
     QueryExpression = queryExpression;
     UpdateEntity    = updateEntity;
     LinqCommandAnalyzer.Analyze(this);
 }
コード例 #3
0
 internal LinqCommand(LinqCommandInfo info, EntityInfo targetEntity, object[] parameterValues) {
   Info = info;
   Kind = info.CommandKind;
   CommandType = info.CommandType;
   TargetEntity = targetEntity;
   ParameterValues = parameterValues;
   Util.Check(ParameterValues.Length == info.Lambda.Parameters.Count, "Parameter values count ({0}) does not match parameter count ({1}) in lambda: {2}.",
       parameterValues.Length, Info.Lambda.Parameters.Count, Info.Lambda);
 }
コード例 #4
0
ファイル: LinqCommand.cs プロジェクト: yuanfei05/vita
 internal LinqCommand(LinqCommandInfo info, EntityInfo targetEntity, object[] parameterValues)
 {
     Info = info;
       Kind = info.CommandKind;
       CommandType = info.CommandType;
       TargetEntity = targetEntity;
       ParameterValues = parameterValues;
       Util.Check(ParameterValues.Length == info.Lambda.Parameters.Count, "Parameter values count ({0}) does not match parameter count ({1}) in lambda: {2}.",
       parameterValues.Length, Info.Lambda.Parameters.Count, Info.Lambda);
 }
コード例 #5
0
ファイル: LinqCommandInfo.cs プロジェクト: yuanfei05/vita
 public LinqCommandInfo(LinqCommand command, QueryOptions options, LinqCommandFlags flags,
     List<Type> entityTypes, string cacheKey, List<ParameterExpression> externalParameters,
     List<LambdaExpression> includes)
 {
     CommandType = command.CommandType;
       CommandKind = command.Kind;
       Options = options;
       Flags = flags;
       EntityTypes = entityTypes;
       CacheKey = cacheKey;
       ExternalParameters = externalParameters;
       Includes = includes;
 }
コード例 #6
0
ファイル: LinqCommandInfo.cs プロジェクト: kouweizhong/vita
 public LinqCommandInfo(LinqCommand command, QueryOptions options, LinqCommandFlags flags,
                        List <Type> entityTypes, string cacheKey, List <ParameterExpression> externalParameters,
                        List <LambdaExpression> includes)
 {
     CommandType        = command.CommandType;
     CommandKind        = command.Kind;
     Options            = options;
     Flags              = flags;
     EntityTypes        = entityTypes;
     CacheKey           = cacheKey;
     ExternalParameters = externalParameters;
     Includes           = includes;
 }
コード例 #7
0
ファイル: LinqCommands.cs プロジェクト: radtek/vita
 public LinqCommand(EntitySession session, LinqCommandKind kind, LinqOperation operation)
 {
     Session   = session;
     Kind      = kind;
     Operation = operation;
 }
コード例 #8
0
 public LinqCommand(EntityQuery query, LinqCommandType commandType, LinqCommandKind kind, EntityInfo targetEntity) {
   Kind = kind; 
   CommandType = commandType;
   Query = query;
   TargetEntity = targetEntity;
 }
コード例 #9
0
 public override bool IsSqlTier(System.Linq.Expressions.Expression expression, LinqCommandKind queryUse)
 {
     //MS SQL does not allow comparison operations in SELECT list
       if (expression.Type == typeof(bool)) {
     switch (expression.NodeType) {
       case ExpressionType.LessThan: case ExpressionType.LessThanOrEqual:
       case ExpressionType.GreaterThan:  case ExpressionType.GreaterThanOrEqual:
       case ExpressionType.Equal:  case ExpressionType.NotEqual:
     return false; //means SQL wouldn't support it
     }
       }//if
       return base.IsSqlTier(expression, queryUse);
 }
コード例 #10
0
 public override bool IsSqlTier(System.Linq.Expressions.Expression expression, LinqCommandKind queryUse)
 {
     //MS SQL does not allow comparison operations in SELECT list
     if (expression.Type == typeof(bool))
     {
         switch (expression.NodeType)
         {
         case ExpressionType.LessThan:
         case ExpressionType.LessThanOrEqual:
         case ExpressionType.GreaterThan:
         case ExpressionType.GreaterThanOrEqual:
         case ExpressionType.Equal:
         case ExpressionType.NotEqual:
             return(false); //means SQL wouldn't support it
         }
     }//if
     return(base.IsSqlTier(expression, queryUse));
 }