SideKick.Core 1.0.2

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

// Install SideKick.Core as a Cake Tool
#tool nuget:?package=SideKick.Core&version=1.0.2

SideKick.Core Nuget Nuget

<img src="https://raw.githubusercontent.com/DennisPitallano/SideKick.Core/master/SideKick.Core/sidekick.png" alt="SideKick" height="100" style="zoom:25%;" /> Flyweight C# library for your .NET Core Applications. You can use this library to perform commonly use conversions, validations, and other object helpers.

Installation

  1. Download and Install the latest SideKick.Core from NuGet using Package Manager, CLI or by adding it to Package Reference:

    <PackageReference Include="SideKick.Core" Version="1.0.2" />
    
    dotnet add package SideKick.Core --version 1.0.2
    
    PM> Install-Package SideKick.Core -Version 1.0.2
    
  2. Import the following namespace in the class:

    using SideKick.Core;
    

Sample Usage

Validators

Validate string value:

//import 
using SideKick.Core.Validation;

var strValue = "1234567890";
if (strValue.IsNumber())
{
    //Do something here
}

var myEmailAddress = "dpitallano@gmail.com";
if (myEmailAddress.IsValidEmailAddress())
{
    //Do something here
}
Helper
//import 
using SideKick.Core.Helper;
 
var myBirthDate = new DateTime(1990,12,2);
Console.WriteLine($"I was born {myBirthDate.RelativeFormat()}.");

//output
I was born 30 years ago.
Converters
using SideKick.Core.Converter;

var strNumber = "123.90";
Console.WriteLine($"Decimal Value: {strNumber.ToDecimal()}");

//output
Decimal Value: 123.90

List of Available Extension

Validators
bool IsValidEmailAddress(this string value)
bool ContainsSpecialCharacter(this string value)
bool IsValidPersonName(this string value)
bool IsIPv6Address(this string value)
bool IsIPAddress(this string value)
bool IsValidUrl(this string value)
bool IsValidDomain(this string value)

bool IsValidDateTime(this DateTime? date)
bool IsValidDateTime(this DateTime date)
bool IsNumber(this string value)
bool IsWholeNumber(this string value)
bool IsDecimalNumber(this string value)
bool IsFloatNumber(this string value)
bool IsBoolean(this string value)
bool IsValidCreditCardNumber(this string value)
bool IsValidJson(this string json)
bool IsValidDateTimeString(this string date)
bool IsFutureDate(this string date)
bool IsValidStandardDateString(this string value)
bool IsHtml(this string value)
bool IsAlphaNumeric(this string value)
bool IsAlphaNumericStrict(this string value)
Helpers
//DateTime Helpers
string RelativeFormat(this DateTime source)
int GetYearsFromDate(this DateTime date)
int GetYearsDifference(this DateTime date, DateTime dateToCompare)
DateTime EndOfDay(this DateTime date)
DateTime EndOfDay(this DateTime date, int timeZoneOffset)
DateTime EndOfWeek(this DateTime date)
DateTime EndOfWeek(this DateTime date, int timeZoneOffset)
DateTime EndOfMonth(this DateTime date)
DateTime EndOfMonth(this DateTime date, int timeZoneOffset)
DateTime EndOfQuarter(this DateTime date)
DateTime EndOfQuarter(this DateTime date, int timeZoneOffset)
DateTime EndOfYear(this DateTime date)
DateTime EndOfYear(this DateTime date, int timeZoneOffset)
DateTime BeginningOfDay(this DateTime date)
DateTime BeginningOfDay(this DateTime date, int timezoneOffset)
DateTime BeginningOfWeek(this DateTime date)
DateTime BeginningOfWeek(this DateTime date, int timezoneOffset)
DateTime BeginningOfMonth(this DateTime date)
DateTime BeginningOfMonth(this DateTime date, int timezoneOffset)
DateTime BeginningOfQuarter(this DateTime date)
DateTime BeginningOfQuarter(this DateTime date, int timezoneOffset)
DateTime BeginningOfYear(this DateTime date)
DateTime BeginningOfYear(this DateTime date, int timezoneOffset)
DateTime IncreaseTime(this DateTime startDate, TimeSpan toAdd)
DateTime DecreaseTime(this DateTime startDate, TimeSpan toSubtract)
DateTime SetTime(this DateTime originalDate, int hour)
DateTime SetTime(this DateTime originalDate, int hour, int minute)
DateTime SetTime(this DateTime originalDate, int hour, int minute, int second)
DateTime SetTime(this DateTime originalDate, int hour, int minute, int second, int millisecond)
DateTime SetHour(this DateTime originalDate, int hour)
DateTime SetMinute(this DateTime originalDate, int minute)
DateTime SetSecond(this DateTime originalDate, int second)
DateTime SetMillisecond(this DateTime originalDate, int millisecond)
DateTime Midnight(this DateTime value)
DateTime Noon(this DateTime value)
DateTime SetDate(this DateTime value, int year)
DateTime SetDate(this DateTime value, int year, int month)
DateTime SetDate(this DateTime value, int year, int month, int day)
DateTime SetYear(this DateTime value, int year)
DateTime SetMonth(this DateTime value, int month)
DateTime SetDay(this DateTime value, int day)
bool IsBefore(this DateTime current, DateTime toCompareWith)
bool IsAfter(this DateTime current, DateTime toCompareWith)
DateTime At(this DateTime current, int hour, int minute)
DateTime At(this DateTime current, int hour, int minute, int second)
DateTime At(this DateTime current, int hour, int minute, int second, int milliseconds)
DateTime FirstDayOfQuarter(this DateTime current)
DateTime FirstDayOfMonth(this DateTime current)
DateTime LastDayOfQuarter(this DateTime current)
DateTime LastDayOfMonth(this DateTime current)
DateTime AddBusinessDays(this DateTime current, int days)
DateTime SubtractBusinessDays(this DateTime current, int days)
bool IsInFuture(this DateTime dateTime)
bool IsInPast(this DateTime dateTime)
DateTime Round(this DateTime dateTime, RoundTo rt)
DateTime FirstDayOfWeek(this DateTime dateTime)
DateTime FirstDayOfYear(this DateTime current)
DateTime LastDayOfWeek(this DateTime current)
DateTime LastDayOfYear(this DateTime current)
DateTime PreviousMonth(this DateTime current)
DateTime NextMonth(this DateTime current)
bool SameDay(this DateTime current, DateTime date)
bool SameMonth(this DateTime current, DateTime date)
bool SameYear(this DateTime current, DateTime date)
//String Helpers	=> coming soon...
//Number Helpers	=> coming soon...
Conversions
string ToBase64Encode(this byte[] inArray)
DateTime ToDateTime(this string value)
DateTime? ToNullableDateTime(this string value)
short ToInt16(this string value)
int ToInt32(this string value)
int? ToNullableInt32(this string value)
long ToInt64(this string value)
long? ToNullableInt64(this string value)
bool ToBoolean(this string value)
float ToFloat(this string value)
decimal ToDecimal(this string value)
double ToDouble(this string value)
string ToBase64Encode(this string value)
string ToBase64Decode(this string value)
byte[] ToByteFromBase64CharArray(this string value)
byte[] ToByteArray(this string value)
string ToDateTimeFormat(this string date, string format)
string ToCamelCase(this string value)

Attribution

<div>Icons made by <a href="https://www.flaticon.com/authors/freepik" title="Freepik">Freepik</a> from <a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a></div>

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. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen 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.0.3 405 1/5/2021
1.0.2 349 12/29/2020
1.0.1 361 12/29/2020
1.0.0 294 12/29/2020

List of commonly use C# object conveters and validations