Beispiel #1
0
        public bool Matches(Type type, IObjectConverter converter)
        {
            if (type.IsArray && converter.CanBeParsed(type.GetElementType()))
            {
                return(true);
            }



            return(type.IsGenericEnumerable() && converter.CanBeParsed(type.GetGenericArguments()[0]));
        }
Beispiel #2
0
        public virtual object Value(Type type, string key)
        {
            object returnValue = null;

            if (_converter.CanBeParsed(type))
            {
                _data.Value(key, o =>
                {
                    returnValue = convertValue(o, type);
                });
            }

            return(returnValue);
        }
Beispiel #3
0
        public object Value(Type type, string key)
        {
            object returnValue = null;

            if (_converter.CanBeParsed(type))
            {
                _data.Value(key, o =>
                {
                    returnValue = convertValue(o, type);
                });
            }

            if (returnValue == null)
            {
                returnValue = _request.Get(type);
            }

            return(returnValue);
        }