public QueryBuilderContext(IRepositoryQuery source, ICommandOptions options, SearchDescriptor <T> search = null, IQueryBuilderContext parentContext = null, string type = null)
        {
            Source  = source;
            Options = options;
            Search  = search ?? new SearchDescriptor <T>();
            Parent  = parentContext;
            Type    = type ?? ContextType.Default;
            ((IQueryVisitorContextWithAliasResolver)this).RootAliasResolver = options.GetRootAliasResolver();

            var range = GetDateRange();

            if (range != null)
            {
                Data.Add(nameof(range.StartDate), range.GetStartDate());
                Data.Add(nameof(range.EndDate), range.GetEndDate());
            }
        }