private object RowDeserializer(ICqlRow row, ObjectSerializerConventions conventions)
        {
            if (Type.GetTypeCode(_type) != TypeCode.Object)
                return FrameworkTypeRowDeserializer(row, conventions);

            if (_type.Name.Contains("AnonymousType"))
                return AnonymousRowDeserializer(row, conventions);

            var obj = Activator.CreateInstance(_type);

            foreach (var prop in _type.GetProperties(BindingFlags.Public | BindingFlags.Instance))
            {
                var name = prop.Name;
                if (conventions.KeyPropertyNames.Contains(name, conventions.AreKeyPropertyNamesCaseSensitive ? StringComparer.OrdinalIgnoreCase : StringComparer.Ordinal))
                {
                    prop.SetValue(obj, Convert.ChangeType(row.Key, prop.PropertyType), null);
                    continue;
                }

                if (row.Columns.Any(x => x.ColumnName == name))
                    prop.SetValue(obj, Convert.ChangeType(row[name], prop.PropertyType), null);
            }

            return obj;
        }
        public object Deserialize(ICqlRow row, ObjectSerializerConventions conventions = null)
        {
            conventions = conventions ?? new ObjectSerializerConventions();

            var func = GenerateRowDeserializer();
            return func(row, conventions);
        }
        private object FrameworkTypeRowDeserializer(ICqlRow row, ObjectSerializerConventions conventions)
        {
            if (row.Columns.Count > 0)
                return Convert.ChangeType(row.Columns[0].ColumnValue, _type);

            return Convert.ChangeType(row.Key, _type);
        }
        internal CqlQueryEvaluator(ObjectSerializerConventions conventions = null)
        {
            SelectFieldsArray = new List<string>();
            OrderByFieldsArray = new List<string>();

            _conventions = conventions;
        }
        public IEnumerable<object> Deserialize(IEnumerable<ICqlRow> rows, ObjectSerializerConventions conventions = null)
        {
            conventions = conventions ?? new ObjectSerializerConventions();

            var func = GenerateRowDeserializer();

            foreach (var row in rows)
                yield return func(row, conventions);
        }
        private object AnonymousRowDeserializer(ICqlRow row, ObjectSerializerConventions conventions)
        {
            var props = _type.GetProperties(BindingFlags.Public | BindingFlags.Instance);
            var args = new List<object>();

            foreach (var prop in props)
            {
                var name = prop.Name;

                if (row.Columns.Any(x => x.ColumnName == name))
                    args.Add(Convert.ChangeType(row[name], prop.PropertyType));
            }

            return Activator.CreateInstance(_type, args.ToArray());
        }
        private object AnonymousRowDeserializer(ICqlRow row, ObjectSerializerConventions conventions)
        {
            var props = _type.GetProperties(BindingFlags.Public | BindingFlags.Instance);
            var args = new List<object>();

            foreach (var prop in props)
            {
                var name = prop.Name;
                if (conventions.KeyPropertyNames.Contains(name, conventions.AreKeyPropertyNamesCaseSensitive ? StringComparer.OrdinalIgnoreCase : StringComparer.Ordinal))
                {
                    args.Add(Convert.ChangeType(row.Key, prop.PropertyType));
                    continue;
                }

                if (row.Columns.Any(x => x.ColumnName == name))
                    args.Add(Convert.ChangeType(row[name], prop.PropertyType));
            }

            return Activator.CreateInstance(_type, args.ToArray());
        }
        public static string GetCql(Expression expression, ObjectSerializerConventions conventions = null)
        {
            var eval = new CqlQueryEvaluator(conventions);
            eval.Evaluate(expression);

            return eval.Query;
        }