querybuilder icon indicating copy to clipboard operation
querybuilder copied to clipboard

Why create a new QueryFactory when it can be assigned via an XQuery property

Open ghost opened this issue 2 years ago • 1 comments

Hi,

Why create a new QueryFactory when it can be assigned via an XQuery property.

       internal static QueryFactory CreateQueryFactory(XQuery xQuery)
        {
            //I don't understand what is the meaning of this new creation?
            var factory = new QueryFactory(xQuery.Connection, xQuery.Compiler); // Original

            //While it can be assigned like this:
            var factory = xQuery.QueryFactory; // Another solution

            factory.Logger = xQuery.Logger;

            return factory;
        }

Thanks

ghost avatar Aug 20 '21 17:08 ghost

Looks like a candidate for an extension method in the package.

Why not fork, and maybe a PR?

generik0 avatar Jan 29 '22 07:01 generik0