MoreDotNet 2.0.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package MoreDotNet --version 2.0.2
                    
NuGet\Install-Package MoreDotNet -Version 2.0.2
                    
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="MoreDotNet" Version="2.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MoreDotNet" Version="2.0.2" />
                    
Directory.Packages.props
<PackageReference Include="MoreDotNet" />
                    
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 MoreDotNet --version 2.0.2
                    
#r "nuget: MoreDotNet, 2.0.2"
                    
#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 MoreDotNet@2.0.2
                    
#: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=MoreDotNet&version=2.0.2
                    
Install as a Cake Addin
#tool nuget:?package=MoreDotNet&version=2.0.2
                    
Install as a Cake Tool

MoreDotNet

Status

NuGet version

Summary

This project is a collection of handy extension methods for the .NET Framework. The functionality of this package can be separated in the following groups:

Extension methods for common .NET types:


  • ICollection:
AddRange()
  • IDictionary:
GetOrDefault()
GetKeyIgnoringCase()
  • IEnumerable:
ForEach()
EmptyIfNull()
Shuffle()
ToString()
IsNullOrEmpty()
ToHashSet()
  • IList:
BinarySearch()
ToDataTable()
InsertionSort()
InsertWhere()
RemoveAll()
  • bool:
WhenTrue()
WhenFalse()
  • ByteArray:
GetString()
  • IConvertible:
To()
ToOrDefault()
ToOrOther()
ToOrNull()
  • IDataRecord:
GetNullable()
  • DateTime:
FirstDayOfMonth()
LastDayOfMonth()
NextDate()
Midnight()
Noon()
WithTime()
IsFuture()
IsPast()
IsWorkDay()
IsWeekend()
NextWorkday()
  • Enum:
GetDisplayName()
GetDescription()
  • Generics
IsBetween()
GetMemberName()
  • int:
RangeTo()
  • object:
Is()
IsNot()
As()
ToDictionary()
  • OperatingSystem:
IsWinXpOrHigher()
IsWinVistaOrHigher()
IsWin7OrHigher()
IsWin8OrHigher()
  • Random:
OneOf()
NextBool()
NextChar()
NextDateTime()
NextDouble()
NextString()
NextTimeSpan()
  • Stream:
ToByteArray()
ToStream()
  • string:
ToTitleCase()
CaseToWords()
Capitalize()
IsLike()
ToMaximumLengthString()
NthIndexOf()
RemoveLastCharacter()
RemoveLast()
RemoveFirstCharacter()
RemoveFirst()
  • Type:
IsNullable()
GetCoreType()
  • Xml:
XmlSerialize()
XmlDeserialize()
  • RomanNumeral:
IsValidRomanNumeral()
ParseRomanNumeral()
ToRomanNumeralString()

Static helpers


  • Directory:
CreateTempDirectory()
SafeDeleteDirectory()
  • File:
SaveStringToTempFile()
SaveByteArrayToTempFile()

Wrappers for transforming common static methods to instance methods


Example:

string.IsNullOrWhiteSpace(testStringVar)

Is transformed to:

testStringVar.IsNullOrWhiteSpace()

Installation

NOTE: The package is still under development and some bugs may exist!

You can install the library using NuGet into your project:

Install-Package MoreDotNet

Changelog

Version 0.7

  • Switched to .NET Standard.
  • APIs for Color, OperatingSystem and DataTable removed due to them missing in the .NET Standard API.

License

This package has MIT license. Refer to the LICENSE for detailed information.

Any questions, comments or additions

If you have a feature request or bug report, leave an issue on the issues page or send a pull request. For general questions and comments, use the StackOverflow forum.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  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.
  • net8.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
2.1.0 305 12/29/2023
2.0.4 202 12/16/2023
2.0.3 168 12/16/2023
2.0.2 170 12/16/2023
2.0.1 170 12/16/2023
2.0.0 186 12/16/2023
1.0.0 786 4/8/2020
0.7.2 1,307 10/2/2017
0.7.1 1,357 5/13/2017
0.7.0 1,306 5/13/2017
0.6.0 1,462 10/22/2016
0.5.1 1,337 10/22/2016
0.5.0 1,345 9/29/2016
0.4.0 1,492 7/1/2016
0.3.5 1,433 5/9/2016
0.3.4 1,334 5/9/2016
0.3.3 1,378 5/9/2016
0.3.2 1,388 5/9/2016
0.3.1 1,357 5/9/2016
0.3.0 1,361 5/8/2016
Loading failed