Eventualist.Extensions 4.0.0.4

dotnet add package Eventualist.Extensions --version 4.0.0.4
                    
NuGet\Install-Package Eventualist.Extensions -Version 4.0.0.4
                    
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="Eventualist.Extensions" Version="4.0.0.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Eventualist.Extensions" Version="4.0.0.4" />
                    
Directory.Packages.props
<PackageReference Include="Eventualist.Extensions" />
                    
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 Eventualist.Extensions --version 4.0.0.4
                    
#r "nuget: Eventualist.Extensions, 4.0.0.4"
                    
#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 Eventualist.Extensions@4.0.0.4
                    
#: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=Eventualist.Extensions&version=4.0.0.4
                    
Install as a Cake Addin
#tool nuget:?package=Eventualist.Extensions&version=4.0.0.4
                    
Install as a Cake Tool

Eventualist.Extensions

This package contains some small but handy extension methods

A number of simple extensions to bool, and collections. Mainly used for my own website, but you can peruse for your own pleasure.

  • Bool: AddNot (transforms a string according to the value of the bool)
  • Bool: ToYesOrNo (transforms bool to a yes or no)
  • Collection: IsEmpty: returns true if collection is empty
  • Collection: IsNotEmpty: returns true if collection is not empty
  • Collection Divide: returns a list of sublists of the collections, with a specified maximumlength

In 1.0.0.13

  • Memoize, to automatically cache function results. Just apply Memoize() to a Function object to get a memoized version. Caveats: it only works for up to two arguments, and it does not much benefit recursive functions.

In 2.0.0.0

  • No new functionality but now compatible with .net 6.0. For compatibility with older versions use 1.0.0.19</Description>

In 2.0.0.9

  • Added new functionality for Memoize: up to six arguments are now supported

In 2.0.0.15

  • Updated to .NET 7. Added extra unit tests and null safety checks

In 3.0.0.9

  • Update to .NET 8

In 3.0.0.17

  • Added the MustComeBefore attribute to make sure dates in your model are always in the right order.

In 4.0.0.0

  • Updated to .NET 9.0
  • Added the MustComeBefore attribute to make sure dates in your model are always in the right order. This is useful for validating that a start date comes before an end date, for example.
  • Updated the ExtendedDictionary to make it more performant and thread-safe.
  • The ConvertToMimeType now handles a greater range of possibilities.
  • The HasCorrectExtension method has been improved to handle more file types and extensions.
  • The Titleize method has been improved to handle more edge cases and provide better title formatting.
  • So has the Abbreviate method, which now handles more complex cases and provides better abbreviation results.
  • The Truncate has been added which does not respect word boundaries, allowing for more precise truncation of strings.
  • A StripHtml method has been added to remove HTML tags from strings, making it easier to work with plain text.
  • Plus three small utility methods.

An example use of this would be:

    internal class TimePeriod
    {
        [MustComeBefore("EndDate")]
        public DateTime StartDate { get; set; }
        public DateTime EndDate { get; set; }
    }

This attribute works with the standard .NET validators.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net9.0

    • 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.

Version Downloads Last Updated
4.0.0.4 155 6/5/2025
3.0.0.17 293 11/25/2023
3.0.0.9 137 11/25/2023
2.0.0.17 284 3/5/2023
2.0.0.15 333 1/29/2023
2.0.0.11 456 9/3/2022
2.0.0.9 489 7/14/2022
2.0.0.1 481 7/14/2022
1.0.0.19 598 1/4/2021