Beispiel #1
0
        public static IValueSetter Create(object data)
        {
            IValueSetter valueSetter;

            if (data is IDictionary <string, object> )
            {
                valueSetter = new DynamicValueSetter();
            }
            else
            {
                valueSetter = new ReflectValueSetter();
            }

            return(valueSetter);
        }
Beispiel #2
0
        public static IValueSetter Create(this BaseHadlerConfig queryConfig)
        {
            IValueSetter valueSetter;

            if (queryConfig.Config == null ||
                string.IsNullOrEmpty(queryConfig.Config[TypeStr].ToSingleData <string>(string.Empty)))
            {
                valueSetter = new DynamicValueSetter();
            }
            else
            {
                var typeStr = queryConfig.Config[TypeStr].ToSingleData <string>().Split(SqlKeyWorld.Split3);
                valueSetter = new ReflectValueSetter(typeStr[0], typeStr[1]);
            }

            return(valueSetter);
        }