ateaseproject / atease

@Ease is a set of extensions and helpers.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

@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)

Types

object.GetPropertyValue(propertyName)
object.GetFieldValue(fieldName)
object.HasAttribute<CustomAttribute>()
object.SingleAttributeValue<TAttribute>(propertyName,attributeName)
propertyInfo.SingleAttributeValue<TAttribute>(attributeName)

About

@Ease is a set of extensions and helpers.

License:MIT License


Languages

Language:C# 90.6%Language:PowerShell 6.2%Language:Shell 3.1%Language:Batchfile 0.1%