Skip to content

hadi-jabbari/atease

 
 

Repository files navigation

@Ease

NuGet @Ease is a set of extensions and helpers.

Quick links

Change logs | Project Repository

Installation

Available for .NET Standard 2.0+

NuGet

PM> Install-Package AtEase

Features

  • Extensions for Collections, Enum, String and other types
  • Persian DateTime extension
  • OperationResult for returning an object that shows succeed or faild operation with data and errors.
  • Provide DSL for C# methods

Convert class to Http query string

testClass.ToQueryString();

DateTime

dateTime.ToPersianDateTime(format);  // تبدیل به تاریخ شمسی

Sequential GUID

Guid.NewGuid().AsSequentialGuid();
GuidGeneratorExtensions.NewSequentialGuid();

RegularExpression

string.IsValidShamsiYear(); // تاریخ شمسی است
string.IsValidTime();
string.IsValidEmail();

String

string.IsWord();
string.ToSpacingSentence();
string.ToSentence();
string.ToSnakeCase();
string.FixPersianKeyboardLayou(); // فیکس حروفی عربی و فارسی
string.ToPersianNumber();  // تبدیل اعداد به اعداد فارسی
string.IsNull();
string.IsNullOrEmptyOrWhiteSpace();

Enum

@enum.ToInt();  // enum to int
value.AsEnum<TestEnum>(); // int to enum
@enum.GetDisplayName();
@enum.GetDescription();
EnumToList<Enum>; // get list of values

Collections

collection.IsNullOrEmpty()
collection.IsNotNullOrEmpty()
collection.NotAny()

Numbers

nullableDouble.ToNullableDecimal()
collection.IsZeroOrMin()
collection.IsEven()
collection.IsOdd()
collection.NextRandom()

Numbers to Span

number.Milliseconds()
number.Seconds()
number.Minutes()
number.Hours()
number.Days()
number.Weeks()

Operation System

IsWindows()
IsMacOs()
IsLinux()

string.RunAsCmd(workingDirectory)
string.RunAsWindowsCmd(workingDirectory)
string.RunAsBashCmd(workingDirectory)

About

@ease is a set of extensions and helpers.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 88.8%
  • PowerShell 7.4%
  • Shell 3.7%
  • Batchfile 0.1%