Skip to content

Adding .NET framework extension methods to basic types that you thought would have been there but aren't

Notifications You must be signed in to change notification settings

halcharger/NExtensions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

91 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NExtensions

NuGet NuGet

Adding .NET framework extension methods to basic types that you thought would have been there but aren't

About

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.

CI build status

Build status

Install

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.

Extensions Summary

#####DateTime extentions

  • AddWeekDays
  • FirstDayOfMonth
  • IsFirstDayOfMonth
  • IsFriday
  • IsLastDayOfMonth
  • IsMonday
  • IsSaturday
  • IsSunday
  • IsThursday
  • IsTuesday
  • IsWednesday
  • IsWeekday
  • IsWeekend
  • LastDayOfMonth

#####Enumerable extentions

  • 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

Detailed Usage

For details usage see the Wiki or read the tests.

About

Adding .NET framework extension methods to basic types that you thought would have been there but aren't

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages