Adding .NET framework extension methods to basic types that you thought would have been there but aren't
NExtensions is a zero-dependency lightweight library containing small simple yet indispensable extension methods for .NET framework base types. These extension methods make your code more concise, more readable and more fluent.
NExtensions can be installed from nuget.org, the package is located over here
From the Package Manager Console in Visual Studio simply run
PM> Install-Package NExtensions
The symbols have also been pushed along with the nuget package so you should be able to step into the source if your Visual Studio is configured correctly. To configure your Visual Studio go to Debug > Options and Settings and make the following changes:
- Under General, turn off �Enable Just My Code�
- Under General, turn on �Enable source server support�. You may have to Ok a security warning.
- Under Symbols, add �http://srv.symbolsource.org/pdb/Public� to the list.
#####DateTime extentions
- AddWeekDays
- FirstDayOfMonth
- IsFirstDayOfMonth
- IsFriday
- IsLastDayOfMonth
- IsMonday
- IsSaturday
- IsSunday
- IsThursday
- IsTuesday
- IsWednesday
- IsWeekday
- IsWeekend
- LastDayOfMonth
- ContainsAll
- ContainsNone
- EmptyIfNull
- ForEach
- GetDuplicates
- HasValues
- IsNullOrEmpty
- None
- ToEnumerable
#####Enum extentions
- GetDescription
- GetValues
- ToEnum
#####Exception extentions
- GetBaseException
#####Numeric extentions
- Absolute
- RoundToMoney
- RoundTo
#####Object extentions
- Clone
- GetProperties
- GetValueForProperty
- SetValueForProperty
- ToNullSafeString
- IsNull
- NotNull
- ToTask
#####String extentions
- Append
- AppendNewLine
- ContainsAll
- ContainsAny
- Copy
- FormatWith
- HasValue
- IsNullOrEmpty
- IsNullOrWhiteSpace
- JoinWith
- JoinWithComma
- JoinWithNewLine
- JoinWithSemiColon
- Remove
- SplitBy
- SplitByComma
- SplitByNewLine
- SplitBySemiColon
- ToBoolean
- ToDecimal
- ToInteger
#####Type extentions
- CreateInstance
- IsBool
- IsDateTime
- IsDecimal
- IsIEnumerable
- IsIList
- IsInt
- IsNotBool
- IsNotDateTime
- IsNotDecimal
- IsNotIEnumerable
- IsNotIList
- IsNotInt
- IsNotNullableBool
- IsNotNullableDateTime
- IsNotNullableDecimal
- IsNotNullableInt
- IsNotString
- IsNotType
- IsNullableBool
- IsNullableDateTime
- IsNullableDecimal
- IsNullableInt
- IsString
- IsType
For details usage see the Wiki or read the tests.