Using static support

The popular MoreLinq NuGet package implements extension methods that are also available now in .Net Core 2.0 e.g. ToHashSet(). That creates a resolution conflict when using both.

Their solution involves "using static." I assume that the F4 using statements don't support "using static" so converted my C# snippet to a C# program and added an appropriate using static line to the top. I didn't get a compiler error on that line, but nor was the desired reference resolved.

Does LinqPad support using static?

For reference: https://github.com/morelinq/MoreLINQ/issues/214

Comments

  • I think you can write it without the using keyword, say you using static "System.Console", you can just write:
    static System.Console
    instead of
    using static System.Console
    in the Namespace Imports tab.
  • Indeed, that works.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!