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:
- 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()
- Directory:
CreateTempDirectory()
SafeDeleteDirectory()
- File:
SaveStringToTempFile()
SaveByteArrayToTempFile()
Example:
string.IsNullOrWhiteSpace(testStringVar)
Is transformed to:
testStringVar.IsNullOrWhiteSpace()
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
- Switched to .NET Standard.
- APIs for Color, OperatingSystem and DataTable removed due to them missing in the .NET Standard API.
Code by Teodor Kurtev. Copyright 2016 Teodor Kurtev.
This package has MIT license. Refer to the LICENSE for detailed information.
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.