ProductivityExtensionMethods 1.0.0-beta.7

This is a prerelease version of ProductivityExtensionMethods.
dotnet add package ProductivityExtensionMethods --version 1.0.0-beta.7
                    
NuGet\Install-Package ProductivityExtensionMethods -Version 1.0.0-beta.7
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ProductivityExtensionMethods" Version="1.0.0-beta.7" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ProductivityExtensionMethods" Version="1.0.0-beta.7" />
                    
Directory.Packages.props
<PackageReference Include="ProductivityExtensionMethods" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ProductivityExtensionMethods --version 1.0.0-beta.7
                    
#r "nuget: ProductivityExtensionMethods, 1.0.0-beta.7"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ProductivityExtensionMethods@1.0.0-beta.7
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ProductivityExtensionMethods&version=1.0.0-beta.7&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=ProductivityExtensionMethods&version=1.0.0-beta.7&prerelease
                    
Install as a Cake Tool

How to use

After referencing the package, a T4 Template file is created in your project that will generate a C# .cs file. Modify top section of the file to enable certain category of extension methods. Nuget will take care of future updates.

Visit FAQ page for more details.

Important Notes

  • If updating, make sure to open the ProductivityExtension.tt file and save to re-generate code.
  • The generated code works in C# projects only.
  • The C# code contains C# 7.3 syntax in some categories. Make sure it is enabled in your project by going to Project Properties → Build → Advanced...
  • The C# code contains Nullable Reference Type feature available in C# 8. It will only be generated if target framework is compatible with .Net Standard 2.1 and above.
  • It is tested on latest versions of Visual Studio 2019/2017.

Known Issues

  • If the nuget package is removed for any reason then immediately added back, no .tt file will be added to the project. This is a bug in Visual Studio/Nuget. The initialization script for the nuget package is not run the second time until Visual Studio is restarted.
  • If package is added to one project, then immediately to another, the second project doesn't get the .tt file. This is due to the same bug as above and VS should be restarted between adds.
There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

  • .NETStandard 2.1

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

- Configurable namespace for the generated code, giving more flexibility to prevent collision when package is added to more than one referenced assembly.
- Extension methods are now in global root namespace by default, eliminating the need to include usings.
- Max and Min method for IComparable category
- PickFirst, Flatten and AreAllEqual methods in IEnumerable category, with proper array overloads.
- Ensuring that all overloads that accept comparer delegate also have an overload that accept hash calculator delegate for performance improvement for large object comparisons.
- ADO.net extensions category is dropped.
- Overall bug fixes and refactoring of the extension methods.