<commit_before>using System;
using System.Linq.Expressions;
using Flepper.QueryBuilder.Utils;
using Flepper.QueryBuilder.Utils.Extensions;
using System.Linq;

namespace Flepper.QueryBuilder
{
    internal partial class QueryBuilder : ISelectCommand
    {
        public ISelectCommand SelectCommand()
        {
            QueryColumns = new[] { (SqlColumn)"*" };
            Command.Append("SELECT * ");
            return this;
        }

        public ISelectCommand SelectCommand(params SqlColumn[] columns)
        {
            if (columns.Any(c => c == null)) throw new ArgumentNullException(nameof(columns), "All columns names should not be null");

            QueryColumns = columns;
            Command.AppendFormat("SELECT {0}", columns.Select(c => c.ToString()).JoinColumns());
            return this;
        }

        public ISelectCommand SelectCommandWithDistinct(params SqlColumn[] columns)
        {
            if (columns.Any(c => c == null)) throw new ArgumentNullException(nameof(columns), "All columns names should not be null");

            QueryColumns = columns;
            Command.AppendFormat("SELECT DISTINCT {0}", columns.Select(c => c.ToString()).JoinColumns());
            return this;
        }

        public ISelectCommand SelectCommand<T>()
            where T : class
            => SelectCommand(Cache.GetTypeProperties<T>());

        public ISelectCommand SelectCommand<T>(Expression<Func<T, object>> expression)
            where T : class
            => SelectCommand(Cache.GetPropertiesFromExpression(expression));

        public ISelectCommand SelectCommand<T>(params SqlColumn[] columns)
         where T : class
            => SelectCommand(columns);

      
    }
}
<commit_msg>improvement in the SelectCommand code<commit_after>using System;
using System.Linq.Expressions;
using Flepper.QueryBuilder.Utils;
using Flepper.QueryBuilder.Utils.Extensions;
using System.Linq;

namespace Flepper.QueryBuilder
{
    internal partial class QueryBuilder : ISelectCommand
    {
        public ISelectCommand SelectCommand()
        {
            QueryColumns = new[] { (SqlColumn)"*" };
            Command.Append("SELECT * ");
            return this;
        }

        public ISelectCommand SelectCommand(params SqlColumn[] columns)
        {
            CheckNullColumnException(columns);

            QueryColumns = columns;
            Command.AppendFormat("SELECT {0}", columns.Select(c => c.ToString()).JoinColumns());
            return this;
        }


        public ISelectCommand SelectCommandWithDistinct(params SqlColumn[] columns)
        {
            CheckNullColumnException(columns);

            QueryColumns = columns;
            Command.AppendFormat("SELECT DISTINCT {0}", columns.Select(c => c.ToString()).JoinColumns());
            return this;
        }

        public ISelectCommand SelectCommand<T>()
            where T : class
            => SelectCommand(Cache.GetTypeProperties<T>());

        public ISelectCommand SelectCommand<T>(Expression<Func<T, object>> expression)
            where T : class
            => SelectCommand(Cache.GetPropertiesFromExpression(expression));

        public ISelectCommand SelectCommand<T>(params SqlColumn[] columns)
         where T : class
            => SelectCommand(columns);

        private static void CheckNullColumnException(SqlColumn[] columns)
        {
            if (columns.Any(c => c == null))
                throw new ArgumentNullException(nameof(columns), "All columns names should not be null");
        }

    }
}

{'fraction_non_alphanumeric': 0.10095613048368954, 'fraction_numerical': 0.0011248593925759281, 'mean_word_length': 2.521782178217822, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 28, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3945742', 'n_tokens_mistral': 872, 'n_tokens_neox': 847, 'n_words': 209}