DotaCore.Extensions 15.2.1

dotnet add package DotaCore.Extensions --version 15.2.1                
NuGet\Install-Package DotaCore.Extensions -Version 15.2.1                
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="DotaCore.Extensions" Version="15.2.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DotaCore.Extensions --version 15.2.1                
#r "nuget: DotaCore.Extensions, 15.2.1"                
#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 DotaCore.Extensions as a Cake Addin
#addin nuget:?package=DotaCore.Extensions&version=15.2.1

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

DotaCore.Extensions

AssemblyExtensions

string GetDirectoryPathOrNull(this Assembly assembly)

ByteExtensions

byte[] Compress(this byte[] bytes)

byte[] Decompress(this byte[] bytes)

T Object<T>(this byte[] bytes)

Check

T NotNull<T>(T value, [InvokerParameterName] [NotNull] string parameterName)

string NotNullOrEmpty(string value, [InvokerParameterName] [NotNull] string parameterName)

string NotNullOrWhiteSpace(string value, [InvokerParameterName] [NotNull] string parameterName)

ICollection<T> NotNullOrEmpty<T>(ICollection<T> value, [InvokerParameterName] [NotNull] string parameterName)

ClaimExtensions

void AddJti(this ICollection<Claim> claims)

void AddRoles(this ICollection<Claim> claims, string[] roles)

void AddSub(this ICollection<Claim> claims, string sub)

void AddClaim(this ICollection<Claim> claims, string type, string value)

ClaimsPrincipalExtensions

Claim Claim(this ClaimsPrincipal claimsPrincipal, string claimType)

IEnumerable<string> ClaimRoles(this ClaimsPrincipal claimsPrincipal)

IEnumerable<string> Claims(this ClaimsPrincipal claimsPrincipal, string claimType)

string ClaimSub(this ClaimsPrincipal claimsPrincipal)

long Id(this ClaimsPrincipal claimsPrincipal)

IEnumerable<T> Roles<T>(this ClaimsPrincipal claimsPrincipal) where T : Enum

T RolesFlag<T>(this ClaimsPrincipal claimsPrincipal) where T : Enum

string ClaimValue(this ClaimsPrincipal claimsPrincipal, string claimType)

string ClaimValue(this IEnumerable<Claim> claims, string claimType)

string ClaimNameIdentifier(this ClaimsPrincipal claimsPrincipal)

CollectionExtensions

bool IsNullOrEmpty<T>(this ICollection<T> source)

bool AddIfNotContains<T>(this ICollection<T> source, T item)

DateTimeExtensions

DateTime NextDateTime(this DateTime dateTime, DayOfWeek[] days, TimeSpan[] times)

DateTime NextDateTime(this DateTime dateTime, params DayOfWeek[] days)

DateTime SetTime(this DateTime dateTime, int hours, int minutes, int seconds)

DateTime NowBRA(this DateTime dateTime)

DateTime Now(this DateTime dateTime, TimeZoneInfo timeZoneInfo)

DirectoryInfoExtensions

FileInfo GetFile(this DirectoryInfo directoryInfo, string name)

EnumerableExtensions

DataTable ConvertToDataTable<T>(this IEnumerable<T> data)

string JoinAsString(this IEnumerable<string> source, string separator)

string JoinAsString<T>(this IEnumerable<T> source, string separator)

IEnumerable<T> WhereIf<T>(this IEnumerable<T> source, bool condition, Func<T, bool> predicate)

IEnumerable<T> WhereIf<T>(this IEnumerable<T> source, bool condition, Func<T, int, bool> predicate)

EnumExtensions

string GetDescription(this Enum value)

string[] ToArray(this Enum value)

HttpResponseHeadersExtensions

void SetCookie(this HttpResponseHeaders headers, Cookie cookie)

JsonExtensions

string ToJsonString(this object obj, bool camelCase = false, bool indented = false)

string ToJsonString(this object obj, JsonSerializerSettings settings)

T FromJsonString<T>(this string value)

T FromJsonString<T>(this string value, JsonSerializerSettings settings)

object FromJsonString(this string value, Type type, JsonSerializerSettings settings)

MemberInfoExtensions

TAttribute GetSingleAttributeOrNull<TAttribute>(this MemberInfo memberInfo, bool inherit = true) where TAttribute : Attribute

TAttribute GetSingleAttributeOfTypeOrBaseTypesOrNull<TAttribute>(this Type type, bool inherit = true) where TAttribute : Attribute

ObjectExtensions

byte[] Bytes(this object obj)

string Serialize(this object obj)

bool IsNull(this object value)

bool IsNotNull(this object value)

T DeepClone<T>(this T obj)

PropertyInfoExtensions

IDictionary ToDictionary(this IEnumerable<PropertyInfo> properties)

QueryableExtensions

IQueryable<T> Filter<T>(this IQueryable<T> queryable, string property, object value)

IQueryable<T> Filter<T>(this IQueryable<T> queryable, string property, string comparison, object value)

IQueryable<T> Order<T>(this IQueryable<T> queryable, string property, bool ascending)

IQueryable<T> Page<T>(this IQueryable<T> queryable, int index, int size)

IQueryable<T> PageBy<T>(this IQueryable<T> query, int skipCount, int maxResultCount)

IQueryable<T> Filter<T>(this IQueryable<T> query, string search)

IQueryable<T> WhereIf<T>(this IQueryable<T> query, bool condition, Expression<Func<T, bool>> predicate)

IQueryable<T> WhereIf<T>(this IQueryable<T> query, bool condition, Expression<Func<T, int, bool>> predicate)

StringExtensions

string CamelCase(this string value)

string RemoveSpecialCharacters(this string value)

T Deserialize<T>(this string value) where T : class

string LowerCamelCase(this string value)

string NonSpecialCharacters(this string value)

string NumericCharacters(this string value)

string RemoveExtraSpaces(this string value)

string EnsureEndsWith(this string str, char c)

string EnsureEndsWith(this string str, char c, StringComparison comparisonType)

string EnsureEndsWith(this string str, char c, bool ignoreCase, CultureInfo culture)

string EnsureStartsWith(this string str, char c)

string EnsureStartsWith(this string str, char c, StringComparison comparisonType)

string EnsureStartsWith(this string str, char c, bool ignoreCase, CultureInfo culture)

bool IsNullOrEmpty(this string str)

bool IsNotNull(this string str)

bool IsNullOrWhiteSpace(this string str)

string IsNullNewValue(this string str, string newValue)

string Left(this string str, int len)

string NormalizeLineEndings(this string str)

int NthIndexOf(this string str, char c, int n)

string RemovePostFix(this string str, params string[] postFixes)

string RemovePreFix(this string str, params string[] preFixes)

string Right(this string str, int len)

string[] Split(this string str, string separator)

string[] Split(this string str, string separator, StringSplitOptions options)

string[] SplitToLines(this string str)

string[] SplitToLines(this string str, StringSplitOptions options)

string ToCamelCase(this string str, bool invariantCulture = true)

string ToCamelCase(this string str, CultureInfo culture)

string ToSentenceCase(this string str, bool invariantCulture = false)

string ToSentenceCase(this string str, CultureInfo culture)

T ToEnum<T>(this string value) where T : struct

T ToEnum<T>(this string value, bool ignoreCase) where T : struct

string ToMd5(this string str)

string ToPascalCase(this string str, bool invariantCulture = true)

string ToPascalCase(this string str, CultureInfo culture)

string Truncate(this string str, int maxLength)

string TruncateWithPostfix(this string str, int maxLength)

string TruncateWithPostfix(this string str, int maxLength, string postfix)

string Base64Encode(this string value)

string Base64Decode(this string base64EncodedData)

string ReplaceAll(this string data, string what, string target)

byte[] GetImageFromUrl(this string url)

string FileToBase64(string path)

string RemoveAccents(this string s)

void ResizeImage(string fileName, string output, int width, int height)

TimeSpanExtensions

string Format(this TimeSpan time)

TimeSpan NextTime(this TimeSpan time, params TimeSpan[] times)

TypeExtensions

IDictionary ToDictionary(this Type type)

Assembly GetAssembly(this Type type)

MethodInfo GetMethod(this Type type, string methodName, int pParametersCount = 0, int pGenericArgumentsCount = 0)
Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on DotaCore.Extensions:

Package Downloads
DotaCore.Objects

DotaCore.Objects

DotaCore.RabbitMQ

DotaCore.RabbitMQ

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
15.2.1 825 4/4/2021