ArjaiSolutions.ExtensionLibrary
1.0.17
See the version list below for details.
dotnet add package ArjaiSolutions.ExtensionLibrary --version 1.0.17
NuGet\Install-Package ArjaiSolutions.ExtensionLibrary -Version 1.0.17
<PackageReference Include="ArjaiSolutions.ExtensionLibrary" Version="1.0.17" />
paket add ArjaiSolutions.ExtensionLibrary --version 1.0.17
#r "nuget: ArjaiSolutions.ExtensionLibrary, 1.0.17"
// Install ArjaiSolutions.ExtensionLibrary as a Cake Addin #addin nuget:?package=ArjaiSolutions.ExtensionLibrary&version=1.0.17 // Install ArjaiSolutions.ExtensionLibrary as a Cake Tool #tool nuget:?package=ArjaiSolutions.ExtensionLibrary&version=1.0.17
ArJaiSolutions Extension Library
ArJaiSolutions extension library contains some basic extensions for string, Objects and Mainly extension for Iquerable to create dynamic expressions.
Dictionary Extensions
DictionaryExtensions.TryReturnValue<TKey, TValue>(System.Collections.Generic.IDictionary<TKey, TValue>, TKey, TValue)
To fetch the value directly from the dictionary for the provided key. else return the default value
String Extensions
string.ToBool()
Converts string to bool if not able to convert, It will return null. Possible values from string to bool are true/false, 0/1,yes/no, y/n.
string.ToBool(bool)
Converts string to bool if not able to convert, It will return the default value provided or false. Possible values from string to bool are true/false, 0/1,yes/no, y/n
string.ToDateTime(string, string)
Converts the given string to Datetime based on the format and culture provided or by Default the format is "ddMMyyyy" and culture is "en-GB"
string.ToDateTime(string, System.Globalization.CultureInfo)
Converts the given string to Datetime based on the format and culture provided
string.ToGuid(string)
Converts Given string and guid formats default guid format ='D' Guid formats can be - "N","D","B","P","X"
string.ToInt()
Converts this string to int if unable to convert it returns null
string.ToInt(int)
Converts this string to int if unable to convert it returns the default number Or 0 (if no default provided)
string.Tolong()
Converts this string to long if unable to convert it returns null
string.Tolong(long)
Converts this string to long if unable to convert it returns the default number Or 0 (if no default provided)
string.ToUTCDateTime()
Converts the given string to UTCDatetime
string.ToEnum<T>()
Converts string to any Enum of the Type "T"
string.ToEnum<T>(T defaultValue)
Converts string to any Enum of the Type "T", with an default value of the Enum
Object Extensions
Object.ConvertToTheGivenType(System.Type)
Converts the object provided to the given type → Except: DateTime - Which is converted to UTCDateTime , bool - Which is converted to bool from (true/false, 0/1, yes/no, y/n)
string.ToBool()
Converts string to bool if not able to convert, It will return null. Possible values from string to bool are true/false, 0/1,yes/no, y/n.
string.ToBool(bool)
Converts string to bool if not able to convert, It will return the default value provided or false. Possible values from string to bool are true/false, 0/1,yes/no, y/n
string.ToInt()
Converts this string to int if unable to convert it returns null
string.ToInt(int)
Converts this string to int if unable to convert it returns the default number Or 0 (if no default provided)
string.Tolong()
Converts this string to long if unable to convert it returns null
string.Tolong(long)
Converts this string to long if unable to convert it returns the default number Or 0 (if no default provided)
Queryable Extensions
IQueryable.PreadicateConditionBasedFiltering<TSource>(System.Linq.IQueryable<TSource>, string, ExtensionLibrary.PreadicateConditions, object)
To create expression for a source with the property and input value based on the condition provided
Exceptions: "ArgumentOutOfRangeException" if the input value is not been able to convert to the same type of the property
QueryableExtensions.GetNavigationPropertyExpression(System.Linq.Expressions.Expression, ExtensionLibrary.PreadicateConditions, object, string[])
Creates an expression for the property in the path provided. You could have an expression created for a sub properties child property e.g. object school has a property of students and you want to get a expression where students have their firstname started with 'A', you need to call this method with expression parameter which means x=> which you can make by doing Expression.Paramter(type(ParentElement),"x") (in our case parent element is school) once you have a parameter set up then call GetNavigationPropertyExpression(parameter,preadicatecondition.condition, "A","students","firstname");
Helpers for Queryable Expression building
QueryableExtensions.GreaterThan<TSource>(System.Linq.IQueryable<TSource>, System.Linq.Expressions.ParameterExpression, System.Linq.Expressions.Expression, System.Linq.Expressions.Expression)
Returns the Expression of "GreaterThan" for the source based on the property and target an example of what is build and returned e.g. (parameter ⇒ parameter.property>target) where parameter is of the type source
QueryableExtensions.GreaterThanOrEqualTo<TSource>(System.Linq.IQueryable<TSource>, System.Linq.Expressions.ParameterExpression, System.Linq.Expressions.Expression, System.Linq.Expressions.Expression, bool)
Returns the Expression of "GreaterThan" for the source based on the property and target an example of what is build and returned e.g. (parameter ⇒ parameter.property>=target) where parameter is of the type source
QueryableExtensions.LessThan<TSource>(System.Linq.IQueryable<TSource>, System.Linq.Expressions.ParameterExpression, System.Linq.Expressions.Expression, System.Linq.Expressions.Expression)
Returns the Expression of "LessThan" for the source based on the property and target an example of what is build and returned e.g. (parameter ⇒ parameter.property<target) where parameter is of the type source
QueryableExtensions.LessThanOrEqualTo<TSource>(System.Linq.IQueryable<TSource>, System.Linq.Expressions.ParameterExpression, System.Linq.Expressions.Expression, System.Linq.Expressions.Expression, bool)
Returns the Expression of "LessThanOrEqual" for the source based on the property and target an example of what is build and returned e.g. (parameter ⇒ parameter.property=<target) where parameter is of the type source
QueryableExtensions.NotEqual<TSource>(System.Linq.IQueryable<TSource>, System.Linq.Expressions.ParameterExpression, System.Linq.Expressions.Expression, System.Linq.Expressions.Expression)
Returns the Expression of "NotEqual" for the source based on the property and target an example of what is build and returned e.g. (parameter ⇒ parameter.property!=target) where paramter is of the type source
QueryableExtensions.MakePreadicateCondition(ExtensionLibrary.PreadicateConditions, System.Linq.Expressions.Expression, System.Linq.Expressions.Expression)
this method makes an Expression for Preadicate Condition.
Preadicate conditions Enum
/// Equals (=) Equals,
/// Equals (!=) NotEqual,
/// Contains as in Type.Contains() Contains,
/// GreaterThan (>) GreaterThan,
/// GreaterThanOrEqual (>=) GreaterThanOrEqual,
/// LessThan (<) LessThan,
/// LessThan (=<) LessThanOrEqual,
/// StartsWith like Type.StartsWith() StartsWith,
/// EndsWith like Type.EndsWith() EndsWith
Product | Versions 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 | 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. |
-
.NETStandard 2.1
- Microsoft.Extensions.Logging.Abstractions (>= 3.1.3)
- Newtonsoft.Json (>= 12.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.