Simple.Extensions 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Simple.Extensions --version 1.0.0                
NuGet\Install-Package Simple.Extensions -Version 1.0.0                
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="Simple.Extensions" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Simple.Extensions --version 1.0.0                
#r "nuget: Simple.Extensions, 1.0.0"                
#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.
// Install Simple.Extensions as a Cake Addin
#addin nuget:?package=Simple.Extensions&version=1.0.0

// Install Simple.Extensions as a Cake Tool
#tool nuget:?package=Simple.Extensions&version=1.0.0                

Simple Extensions

This library provides simple and very direct extensions on some basic types of C#, although it is simple it covers some functionality we need it all the time in many places which sometimes casue code duplication due to its simplicity.

My intension is to collect as much as I can of these simple functions and group them in single basic libray to help me and others in doing their tasks in an easy way.

This library is open source and covered with unit tests to ensure its stability and to be confident to use it in your projects.

In this first release I covered some functions on different C# types and alot is coming soon as well.

What covered now:

String Extensions:

Method Description
IsEmpty() Return true if the value is empty only otherwise return false
IsNull() Return true if the value is null only otherwise return false
IsWhiteSpace() Return true if the value is whitespace only otherwise return false
HasValue() Return true if the string has any value, it is simply a wrapper around IsNullOrWhiteSpace without the headache of negation
RemoveSpecialCharacters() Remove any special characters in the string
RemoveSpaces() Remove any spaces in the string
RemoveSpecialCharactersAndSpaces() Remove any special characters or spaces in the string

DateTime Extensions:

Method Description
ToUnixTimeStamp() Convert any DateTime to unix timestamp

Long Extensions:

Method Description
FromUnixTimeStampToDateTime() Convert unix timestamp to valid DateTime

Queryable Extensions:

Method Description
ToPaginatedListAsync<T> A very simple method for pagination, it is generic which can work on your main entity or projection type. It takes page number and page size and handle the pagination calculations and returns two objects, the first one is the IEnumerable<T> with the specified number of records and meta data object with pagination data

Enum Extensions:

Method Description
GetAttribute<TAttribute> Direct way to retrieve any attribute data associated with enum type whether it is built in attribute as DescriptionAttribute or any custom attribute

You can refer to the unit tests in the repo to see some basic usage for each method.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
1.1.0 195 7/6/2023
1.0.0 159 6/25/2023
0.0.0-alpha.0.9 85 6/25/2023