示例#1
0
 public _BaseModule(string modulePath)
     : base(modulePath)
 {
     Before += ctx =>
     {
         Params = this.Bind<ParameterBag>();
         return null;
     };
 }
示例#2
0
 public _BaseModule(string modulePath)
     : base(modulePath)
 {
     Before += ctx =>
     {
         ViewBag.Title = "ThumbsUp Nancy - " + this.GetType().Name.Replace("Module", string.Empty);
         ViewBag.HasMessage = false;
         Params = this.Bind<ParameterBag>();
         return null;
     };
 }
示例#3
0
 public ConstantExpressionReplacementVisitor(ParameterBag paramValues) => _paramValues = paramValues;
示例#4
0
        public LambdaExpression[] GetMapExpression(Type sourceType, Type destinationType, ParameterBag parameters,
                                                   MemberInfo[] membersToExpand)
        {
            if (sourceType == null)
            {
                throw new ArgumentNullException(nameof(sourceType));
            }
            if (destinationType == null)
            {
                throw new ArgumentNullException(nameof(destinationType));
            }
            if (parameters == null)
            {
                throw new ArgumentNullException(nameof(parameters));
            }
            if (membersToExpand == null)
            {
                throw new ArgumentNullException(nameof(membersToExpand));
            }

            var cachedExpressions = _expressionCache.GetOrAdd(new ExpressionRequest(sourceType, destinationType, membersToExpand, null));

            return(cachedExpressions.Select(e => Prepare(e, parameters)).Cast <LambdaExpression>().ToArray());
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnRead_Click(object sender, EventArgs e)
        {
            ParameterBag pb = new ParameterBag();

            //pb.DeviceID = this._controller
            pb.OperaName = "ReadModbusControl";
            _controller.Execute(pb);
                //_controller.ReadMode();
            //if (this._state == State.None)
            //{
                //_controller.ReadMode();
                //if (Device.Station.CommuniPort != null)
                //{
                //    this.ReadMode();
                //    this.SetState(State.Read);
                //}
                //else
                //{
                //    NUnit.UiKit.UserMessage.DisplayFailure("XD100.XD100Strings.NotConnected");
                //}
            //}
            //else
            //{
            //    //ShowOPError();
            //    NUnit.UiKit.UserMessage.DisplayFailure("XD100.XD100Strings.Executing");
            //}
        }
示例#6
0
 public ForLoopScope(string name, object start, object step, object limit, GeneratorScope scope) : base(scope.Generator, false, scope)
 {
     ParameterName = name;
     parameterKey  = ParameterBag.SetMany(this, start, step, limit);
 }
示例#7
0
 public IQueryable <TResult> To <TResult>(ParameterBag parameters, string[] membersToExpand) =>
 ToCore <TResult>(parameters, membersToExpand.Select(memberName => ReflectionHelper.GetMemberPath(typeof(TResult), memberName)));
示例#8
0
 protected override DbCommand CreateCommand(DbConnection dbConnection, string sql, ParameterBag parameters)
 {
     if (_convertGuidsToText && parameters != null)
     {
         var replacements = new Dictionary <string, object>();
         foreach (var kvp in parameters)
         {
             if (kvp.Value is Guid)
             {
                 replacements[kvp.Key] = kvp.Value.ToString();
             }
         }
         foreach (var kvp in replacements)
         {
             parameters[kvp.Key] = kvp.Value;
         }
     }
     return(base.CreateCommand(dbConnection, sql, parameters));
 }
 public Task <QueryResult> ExecuteReaderAsync(ExecutableQueryExpression query, ParameterBag parameters = null, CancellationToken cancellationToken = default)
 => _activeQueryProvider.ExecuteReaderAsync(query, parameters);
 public QueryResult ExecuteReader(ExecutableQueryExpression query, ParameterBag parameters = null)
 => _activeQueryProvider.ExecuteReader(query, parameters);
 public int ExecuteNonQuery(ExecutableQueryExpression query, ParameterBag parameters = null)
 => _activeQueryProvider.ExecuteNonQuery(query, parameters);
 public QueryResult ExecuteReader(ExecutableQueryExpression query, ParameterBag parameters = null)
 => _transaction.ExecuteReader(query, parameters);
 public Task <int> ExecuteNonQueryAsync(ExecutableQueryExpression query, ParameterBag parameters = null, CancellationToken cancellationToken = default)
 => _transaction.ExecuteNonQueryAsync(query, parameters);
 public int ExecuteNonQuery(ExecutableQueryExpression query, ParameterBag parameters = null)
 => _transaction.ExecuteNonQuery(query, parameters);