public static Dictionary <TKeyOut, TValueOut> To <TKeyOut, TValueOut>(MapType <TKey, TValue> obj)
        {
            //Check to make sure we can convert
            if (KeyType.CreateInstance().CanConvertFrom(typeof(TKeyOut)) && ValueType.CreateInstance().CanConvertFrom(typeof(TValueOut)))
            {
                return(obj.ToDictionary(k => k.Key.GetValue <TKeyOut>(), v => v.Value.GetValue <TValueOut>()));
            }

            throw new ArgumentException(string.Format("can't convert MapType of type {0},{1} to Dictionary of type {2},{3}", typeof(TKey), typeof(TValue), typeof(TKeyOut), typeof(TValueOut)));
        }
        public static MapType <TKey, TValue> From <TKeyIn, TValueIn>(IDictionary <TKeyIn, TValueIn> obj)
        {
            //Check to make sure we can convert
            if (KeyType.CreateInstance().CanConvertFrom(typeof(TKeyIn)) && ValueType.CreateInstance().CanConvertFrom(typeof(TValueIn)))
            {
                return(new MapType <TKey, TValue>(obj.ToDictionary(
                                                      k => (TKey)CassandraObject.GetCassandraObjectFromObject(k.Key, KeyType),
                                                      v => (TValue)CassandraObject.GetCassandraObjectFromObject(v.Value, ValueType))));
            }

            throw new ArgumentException(string.Format("can't convert IDictionary of type {0},{1} to MapType of type {2},{3}", typeof(TKeyIn), typeof(TValueIn), typeof(TKey), typeof(TValue)));
        }
        protected override object GetValueInternal(Type type)
        {
            //If we're converting to a Dictionary<> type
            if (type.IsDictionary())
            {
                var dictionaryTypes = type.GetAllGenericTypes();

                //Check to see if this list's data type can be converted to the requested type
                if (KeyType.CreateInstance().CanConvertTo(dictionaryTypes[0]) && ValueType.CreateInstance().CanConvertTo(dictionaryTypes[1]))
                {
                    return
                        (TypeHelper.PopulateGenericDictionary(
                             _value.ToDictionary(k => (CassandraObject)k.Key, v => (CassandraObject)v.Value),
                             dictionaryTypes[0], dictionaryTypes[1]));
                }
            }

            return(Converter.ConvertTo(_value, type));
        }