Ejemplo n.º 1
0
        public void Add <TValue>(string name, TValue value, ParameterDirection direction)
        {
            parameters.AddOrUpdate(name, new PartialParamInfo <TValue>(typeof(TValue), name, value, direction), (key, paramInfo) => {
                PartialParamInfo <TValue> existing = (PartialParamInfo <TValue>)paramInfo;

                if (!existing.Value.Equals(value) || existing.TypeOfValue != typeof(TValue) || existing.Direction != direction)
                {
                    return(new PartialParamInfo <TValue>(typeof(TValue), name, value, direction));
                }

                return(existing);
            });
        }
Ejemplo n.º 2
0
        public void Add(Type tValue, string name, object value, ParameterDirection direction)
        {
            parameters.AddOrUpdate(name, new PartialParamInfo <object>(tValue, name, value, direction), (key, paramInfo) => {
                PartialParamInfo <object> existing = (PartialParamInfo <object>)paramInfo;

                if (!existing.Value.Equals(value) || existing.TypeOfValue != tValue || existing.Direction != direction)
                {
                    return(new PartialParamInfo <object>(tValue, name, value, direction));
                }

                return(existing);
            });
        }