We have just released a lot of functions for .NET5 in a NuGet package that you can download for free. We collected in this package functions for everyday work to help you with claim, strings, enums, date and time, expressions…
You can browse the full documentation here. Please, give me your feedback in my forum on PureSourceCode.com.
ClaimExtensions Methods
|
Name |
Description |
![Static member Static member](https://camo.githubusercontent.com/8cce04299ad7cf68cc2f1f108b385c3106fb8dbe373bb2c5654f07238811dc6a/68747470733a2f2f617070732e70757265736f75726365636f64652e636f6d2f707363657874656e73696f6e732f69636f6e732f7374617469632e676966) |
GetClaim |
Gets a claim from a list of claims |
![Static member Static member](https://camo.githubusercontent.com/8cce04299ad7cf68cc2f1f108b385c3106fb8dbe373bb2c5654f07238811dc6a/68747470733a2f2f617070732e70757265736f75726365636f64652e636f6d2f707363657874656e73696f6e732f69636f6e732f7374617469632e676966) |
GetClaimValue |
Gets the value of the requested claim if it exists |
![Static member Static member](https://camo.githubusercontent.com/8cce04299ad7cf68cc2f1f108b385c3106fb8dbe373bb2c5654f07238811dc6a/68747470733a2f2f617070732e70757265736f75726365636f64652e636f6d2f707363657874656e73696f6e732f69636f6e732f7374617469632e676966) |
HasRole |
Determines whether the specified role name has role. |
![Static member Static member](https://camo.githubusercontent.com/8cce04299ad7cf68cc2f1f108b385c3106fb8dbe373bb2c5654f07238811dc6a/68747470733a2f2f617070732e70757265736f75726365636f64652e636f6d2f707363657874656e73696f6e732f69636f6e732f7374617469632e676966) |
HasRoles |
Determines whether the specified role name has roles. |
![Static member Static member](https://camo.githubusercontent.com/8cce04299ad7cf68cc2f1f108b385c3106fb8dbe373bb2c5654f07238811dc6a/68747470733a2f2f617070732e70757265736f75726365636f64652e636f6d2f707363657874656e73696f6e732f69636f6e732f7374617469632e676966) |
UpdateClaim |
Updates a claim with a new value |
Crypto
|
Name |
Description |
![Static member Static member](https://camo.githubusercontent.com/8cce04299ad7cf68cc2f1f108b385c3106fb8dbe373bb2c5654f07238811dc6a/68747470733a2f2f617070732e70757265736f75726365636f64652e636f6d2f707363657874656e73696f6e732f69636f6e732f7374617469632e676966) |
BytesToHex |
Byteses to hexadecimal. |
![Static member Static member](https://camo.githubusercontent.com/8cce04299ad7cf68cc2f1f108b385c3106fb8dbe373bb2c5654f07238811dc6a/68747470733a2f2f617070732e70757265736f75726365636f64652e636f6d2f707363657874656e73696f6e732f69636f6e732f7374617469632e676966) |
Decrypt |
Decrypts the specified data. |
![Static member Static member](https://camo.githubusercontent.com/8cce04299ad7cf68cc2f1f108b385c3106fb8dbe373bb2c5654f07238811dc6a/68747470733a2f2f617070732e70757265736f75726365636f64652e636f6d2f707363657874656e73696f6e732f69636f6e732f7374617469632e676966) |
Encrypt |
Encrypts the specified data. |
![Static member Static member](https://camo.githubusercontent.com/8cce04299ad7cf68cc2f1f108b385c3106fb8dbe373bb2c5654f07238811dc6a/68747470733a2f2f617070732e70757265736f75726365636f64652e636f6d2f707363657874656e73696f6e732f69636f6e732f7374617469632e676966) |
HexToBytes |
Hexadecimals to bytes. |
![Static member Static member](https://camo.githubusercontent.com/8cce04299ad7cf68cc2f1f108b385c3106fb8dbe373bb2c5654f07238811dc6a/68747470733a2f2f617070732e70757265736f75726365636f64652e636f6d2f707363657874656e73696f6e732f69636f6e732f7374617469632e676966) |
RandomString |
Randoms the string (lowercase string) |
DateExtensions Methods
|
Name |
Description |
![Static member Static member](https://camo.githubusercontent.com/8cce04299ad7cf68cc2f1f108b385c3106fb8dbe373bb2c5654f07238811dc6a/68747470733a2f2f617070732e70757265736f75726365636f64652e636f6d2f707363657874656e73696f6e732f69636f6e732f7374617469632e676966) |
AscensionDay |
Calculate Ascencion day |
![Static member Static member](https://camo.githubusercontent.com/8cce04299ad7cf68cc2f1f108b385c3106fb8dbe373bb2c5654f07238811dc6a/68747470733a2f2f617070732e70757265736f75726365636f64652e636f6d2f707363657874656e73696f6e732f69636f6e732f7374617469632e676966) |
AshWednesday |
Calculate Ash Wednesday |
![Static member Static member](https://camo.githubusercontent.com/8cce04299ad7cf68cc2f1f108b385c3106fb8dbe373bb2c5654f07238811dc6a/68747470733a2f2f617070732e70757265736f75726365636f64652e636f6d2f707363657874656e73696f6e732f69636f6e732f7374617469632e676966) |
ChristmasDay |
Get the first day of christmas |
![Static member Static member](https://camo.githubusercontent.com/8cce04299ad7cf68cc2f1f108b385c3106fb8dbe373bb2c5654f07238811dc6a/68747470733a2f2f617070732e70757265736f75726365636f64652e636f6d2f707363657874656e73696f6e732f69636f6e732f7374617469632e676966) |
DateDiff |
Dates the difference. |
![Static member Static member](https://camo.githubusercontent.com/8cce04299ad7cf68cc2f1f108b385c3106fb8dbe373bb2c5654f07238811dc6a/68747470733a2f2f617070732e70757265736f75726365636f64652e636f6d2f707363657874656e73696f6e732f69636f6e732f7374617469632e676966) |
EasterSunday |
Calculate Easter Sunday day |
![Static member Static member](https://camo.githubusercontent.com/8cce04299ad7cf68cc2f1f108b385c3106fb8dbe373bb2c5654f07238811dc6a/68747470733a2f2f617070732e70757265736f75726365636f64652e636f6d2f707363657874656e73696f6e732f69636f6e732f7374617469632e676966) |
FirstSundayOfAdvent |
Calculate the first Sunday of Advent |
![Static member Static member](https://camo.githubusercontent.com/8cce04299ad7cf68cc2f1f108b385c3106fb8dbe373bb2c5654f07238811dc6a/68747470733a2f2f617070732e70757265736f75726365636f64652e636f6d2f707363657874656e73696f6e732f69636f6e732f7374617469632e676966) |
GetRandomDateTime |
Generate random DateTime between range |
![Static member Static member](https://camo.githubusercontent.com/8cce04299ad7cf68cc2f1f108b385c3106fb8dbe373bb2c5654f07238811dc6a/68747470733a2f2f617070732e70757265736f75726365636f64652e636f6d2f707363657874656e73696f6e732f69636f6e732f7374617469632e676966) |
GoodFriday |
Calculate Good Friday |
![Static member Static member](https://camo.githubusercontent.com/8cce04299ad7cf68cc2f1f108b385c3106fb8dbe373bb2c5654f07238811dc6a/68747470733a2f2f617070732e70757265736f75726365636f64652e636f6d2f707363657874656e73696f6e732f69636f6e732f7374617469632e676966) |
PalmSunday |
Calculate Palm Sunday |
![Static member Static member](https://camo.githubusercontent.com/8cce04299ad7cf68cc2f1f108b385c3106fb8dbe373bb2c5654f07238811dc6a/68747470733a2f2f617070732e70757265736f75726365636f64652e636f6d2f707363657874656e73696f6e732f69636f6e732f7374617469632e676966) |
WhitSunday |
Calculate Whit Sunday |
EnumerableExtensions Methods
|
Name |
Description |
![Static member Static member](https://camo.githubusercontent.com/8cce04299ad7cf68cc2f1f108b385c3106fb8dbe373bb2c5654f07238811dc6a/68747470733a2f2f617070732e70757265736f75726365636f64652e636f6d2f707363657874656e73696f6e732f69636f6e732f7374617469632e676966) |
PickRandom<T>(IEnumerable<T>) |
Return a random item for an IEnumerable T |
![Static member Static member](https://camo.githubusercontent.com/8cce04299ad7cf68cc2f1f108b385c3106fb8dbe373bb2c5654f07238811dc6a/68747470733a2f2f617070732e70757265736f75726365636f64652e636f6d2f707363657874656e73696f6e732f69636f6e732f7374617469632e676966) |
PickRandom<T>(IEnumerable<T>, Int32) |
Return a random item for an IEnumerable T |
![Static member Static member](https://camo.githubusercontent.com/8cce04299ad7cf68cc2f1f108b385c3106fb8dbe373bb2c5654f07238811dc6a/68747470733a2f2f617070732e70757265736f75726365636f64652e636f6d2f707363657874656e73696f6e732f69636f6e732f7374617469632e676966) |
Shuffle<T>) |
Return source ordered by a new Guid |
EnumExtension Methods
|
Name |
Description |
![Static member Static member](https://camo.githubusercontent.com/8cce04299ad7cf68cc2f1f108b385c3106fb8dbe373bb2c5654f07238811dc6a/68747470733a2f2f617070732e70757265736f75726365636f64652e636f6d2f707363657874656e73696f6e732f69636f6e732f7374617469632e676966) |
GetLocalizedDescription |
Gets localized description |
![Static member Static member](https://camo.githubusercontent.com/8cce04299ad7cf68cc2f1f108b385c3106fb8dbe373bb2c5654f07238811dc6a/68747470733a2f2f617070732e70757265736f75726365636f64652e636f6d2f707363657874656e73696f6e732f69636f6e732f7374617469632e676966) |
GetDescription<T> |
Gets the description. |
![Static member Static member](https://camo.githubusercontent.com/8cce04299ad7cf68cc2f1f108b385c3106fb8dbe373bb2c5654f07238811dc6a/68747470733a2f2f617070732e70757265736f75726365636f64652e636f6d2f707363657874656e73696f6e732f69636f6e732f7374617469632e676966) |
ToEnum<T>(String) |
Extension method to return an enum value of type T for the given string. |
![Static member Static member](https://camo.githubusercontent.com/8cce04299ad7cf68cc2f1f108b385c3106fb8dbe373bb2c5654f07238811dc6a/68747470733a2f2f617070732e70757265736f75726365636f64652e636f6d2f707363657874656e73696f6e732f69636f6e732f7374617469632e676966) |
ToEnum<T>(Int32) |
Extension method to return an enum value of type T for the given int. |
ExpressionExtensions Methods
|
Name |
Description |
![Static member Static member](https://camo.githubusercontent.com/8cce04299ad7cf68cc2f1f108b385c3106fb8dbe373bb2c5654f07238811dc6a/68747470733a2f2f617070732e70757265736f75726365636f64652e636f6d2f707363657874656e73696f6e732f69636f6e732f7374617469632e676966) |
And<T> |
Combines the first predicate with the second using the logical "and". |
![Static member Static member](https://camo.githubusercontent.com/8cce04299ad7cf68cc2f1f108b385c3106fb8dbe373bb2c5654f07238811dc6a/68747470733a2f2f617070732e70757265736f75726365636f64652e636f6d2f707363657874656e73696f6e732f69636f6e732f7374617469632e676966) |
BuildPredicate<T> |
Builds the predicate. |
![Static member Static member](https://camo.githubusercontent.com/8cce04299ad7cf68cc2f1f108b385c3106fb8dbe373bb2c5654f07238811dc6a/68747470733a2f2f617070732e70757265736f75726365636f64652e636f6d2f707363657874656e73696f6e732f69636f6e732f7374617469632e676966) |
Not<T> |
Negates the predicate. |
![Static member Static member](https://camo.githubusercontent.com/8cce04299ad7cf68cc2f1f108b385c3106fb8dbe373bb2c5654f07238811dc6a/68747470733a2f2f617070732e70757265736f75726365636f64652e636f6d2f707363657874656e73696f6e732f69636f6e732f7374617469632e676966) |
Or<T> |
Combines the first predicate with the second using the logical "or". |
![Static member Static member](https://camo.githubusercontent.com/8cce04299ad7cf68cc2f1f108b385c3106fb8dbe373bb2c5654f07238811dc6a/68747470733a2f2f617070732e70757265736f75726365636f64652e636f6d2f707363657874656e73696f6e732f69636f6e732f7374617469632e676966) |
Replace |
Replaces the specified search ex. |
JsonSerializationExtension Methods
|
Name |
Description |
![Static member Static member](https://camo.githubusercontent.com/8cce04299ad7cf68cc2f1f108b385c3106fb8dbe373bb2c5654f07238811dc6a/68747470733a2f2f617070732e70757265736f75726365636f64652e636f6d2f707363657874656e73696f6e732f69636f6e732f7374617469632e676966) |
ReadFromJsonFile<T> |
Reads an object instance from an Json file. Object type must have a parameterless constructor. |
![Static member Static member](https://camo.githubusercontent.com/8cce04299ad7cf68cc2f1f108b385c3106fb8dbe373bb2c5654f07238811dc6a/68747470733a2f2f617070732e70757265736f75726365636f64652e636f6d2f707363657874656e73696f6e732f69636f6e732f7374617469632e676966) |
WriteToJsonFile<T> |
Writes the given object instance to a Json file. Object type must have a parameterless constructor.Only Public properties and variables will be written to the file. These can be any type though, even other classes.If there are public properties/variables that you do not want written to the file, decorate them with the [JsonIgnore] attribute. |
ListExtensions Methods
|
Name |
Description |
![Static member Static member](https://camo.githubusercontent.com/8cce04299ad7cf68cc2f1f108b385c3106fb8dbe373bb2c5654f07238811dc6a/68747470733a2f2f617070732e70757265736f75726365636f64652e636f6d2f707363657874656e73696f6e732f69636f6e732f7374617469632e676966) |
TrimSpace |
Remove spece for each element of a list of string |
StringExtensions Methods
|
Name |
Description |
![Static member Static member](https://camo.githubusercontent.com/8cce04299ad7cf68cc2f1f108b385c3106fb8dbe373bb2c5654f07238811dc6a/68747470733a2f2f617070732e70757265736f75726365636f64652e636f6d2f707363657874656e73696f6e732f69636f6e732f7374617469632e676966) |
CheckIPValid |
Checks the ip valid. |
![Static member Static member](https://camo.githubusercontent.com/8cce04299ad7cf68cc2f1f108b385c3106fb8dbe373bb2c5654f07238811dc6a/68747470733a2f2f617070732e70757265736f75726365636f64652e636f6d2f707363657874656e73696f6e732f69636f6e732f7374617469632e676966) |
ExtractDomainNameFromURL |
Extract a domain name from a full URL |
![Static member Static member](https://camo.githubusercontent.com/8cce04299ad7cf68cc2f1f108b385c3106fb8dbe373bb2c5654f07238811dc6a/68747470733a2f2f617070732e70757265736f75726365636f64652e636f6d2f707363657874656e73696f6e732f69636f6e732f7374617469632e676966) |
GetLast |
Gets the last. |
![Static member Static member](https://camo.githubusercontent.com/8cce04299ad7cf68cc2f1f108b385c3106fb8dbe373bb2c5654f07238811dc6a/68747470733a2f2f617070732e70757265736f75726365636f64652e636f6d2f707363657874656e73696f6e732f69636f6e732f7374617469632e676966) |
IPToNumber |
Gets a number from a IPv4 |
![Static member Static member](https://camo.githubusercontent.com/8cce04299ad7cf68cc2f1f108b385c3106fb8dbe373bb2c5654f07238811dc6a/68747470733a2f2f617070732e70757265736f75726365636f64652e636f6d2f707363657874656e73696f6e732f69636f6e732f7374617469632e676966) |
IsDate |
Determines whether the specified date is date. |
![Static member Static member](https://camo.githubusercontent.com/8cce04299ad7cf68cc2f1f108b385c3106fb8dbe373bb2c5654f07238811dc6a/68747470733a2f2f617070732e70757265736f75726365636f64652e636f6d2f707363657874656e73696f6e732f69636f6e732f7374617469632e676966) |
IsNumeric |
Is the numeric. |
![Static member Static member](https://camo.githubusercontent.com/8cce04299ad7cf68cc2f1f108b385c3106fb8dbe373bb2c5654f07238811dc6a/68747470733a2f2f617070732e70757265736f75726365636f64652e636f6d2f707363657874656e73696f6e732f69636f6e732f7374617469632e676966) |
PadNumber |
Pads the number. |
![Static member Static member](https://camo.githubusercontent.com/8cce04299ad7cf68cc2f1f108b385c3106fb8dbe373bb2c5654f07238811dc6a/68747470733a2f2f617070732e70757265736f75726365636f64652e636f6d2f707363657874656e73696f6e732f69636f6e732f7374617469632e676966) |
RandomString |
Returns a random string with random alphanumeric characters |
![Static member Static member](https://camo.githubusercontent.com/8cce04299ad7cf68cc2f1f108b385c3106fb8dbe373bb2c5654f07238811dc6a/68747470733a2f2f617070732e70757265736f75726365636f64652e636f6d2f707363657874656e73696f6e732f69636f6e732f7374617469632e676966) |
RemoveSpecialCharacter |
Replace special character with another string |
![Static member Static member](https://camo.githubusercontent.com/8cce04299ad7cf68cc2f1f108b385c3106fb8dbe373bb2c5654f07238811dc6a/68747470733a2f2f617070732e70757265736f75726365636f64652e636f6d2f707363657874656e73696f6e732f69636f6e732f7374617469632e676966) |
ReplaceSpace |
Replace spaces with another string |
![Static member Static member](https://camo.githubusercontent.com/8cce04299ad7cf68cc2f1f108b385c3106fb8dbe373bb2c5654f07238811dc6a/68747470733a2f2f617070732e70757265736f75726365636f64652e636f6d2f707363657874656e73696f6e732f69636f6e732f7374617469632e676966) |
ReplaceSpecialCharacters |
Replace non-ASCII characters with their ASCII value |
![Static member Static member](https://camo.githubusercontent.com/8cce04299ad7cf68cc2f1f108b385c3106fb8dbe373bb2c5654f07238811dc6a/68747470733a2f2f617070732e70757265736f75726365636f64652e636f6d2f707363657874656e73696f6e732f69636f6e732f7374617469632e676966) |
Right |
Return the last n characters from a string |
![Static member Static member](https://camo.githubusercontent.com/8cce04299ad7cf68cc2f1f108b385c3106fb8dbe373bb2c5654f07238811dc6a/68747470733a2f2f617070732e70757265736f75726365636f64652e636f6d2f707363657874656e73696f6e732f69636f6e732f7374617469632e676966) |
StripHTML |
Remove all HTML tags from a string |
![Static member Static member](https://camo.githubusercontent.com/8cce04299ad7cf68cc2f1f108b385c3106fb8dbe373bb2c5654f07238811dc6a/68747470733a2f2f617070732e70757265736f75726365636f64652e636f6d2f707363657874656e73696f6e732f69636f6e732f7374617469632e676966) |
SubstringBetween |
Takes a substring between two anchor strings (or the end of the string if that anchor is null) |
![Static member Static member](https://camo.githubusercontent.com/8cce04299ad7cf68cc2f1f108b385c3106fb8dbe373bb2c5654f07238811dc6a/68747470733a2f2f617070732e70757265736f75726365636f64652e636f6d2f707363657874656e73696f6e732f69636f6e732f7374617469632e676966) |
TruncateString(String, Int32) |
Truncate a string after maxLength characters. |
![Static member Static member](https://camo.githubusercontent.com/8cce04299ad7cf68cc2f1f108b385c3106fb8dbe373bb2c5654f07238811dc6a/68747470733a2f2f617070732e70757265736f75726365636f64652e636f6d2f707363657874656e73696f6e732f69636f6e732f7374617469632e676966) |
TruncateString(String, Int32, Boolean) |
Truncate a string after maxLength characters. |
Product |
Versions
Compatible and additional computed target framework versions.
|
.NET
|
net5.0
net5.0 is compatible.
net5.0-windows
net5.0-windows was computed.
net6.0
net6.0 was computed.
net6.0-android
net6.0-android was computed.
net6.0-ios
net6.0-ios was computed.
net6.0-maccatalyst
net6.0-maccatalyst was computed.
net6.0-macos
net6.0-macos was computed.
net6.0-tvos
net6.0-tvos was computed.
net6.0-windows
net6.0-windows was computed.
net7.0
net7.0 was computed.
net7.0-android
net7.0-android was computed.
net7.0-ios
net7.0-ios was computed.
net7.0-maccatalyst
net7.0-maccatalyst was computed.
net7.0-macos
net7.0-macos was computed.
net7.0-tvos
net7.0-tvos was computed.
net7.0-windows
net7.0-windows was computed.
net8.0
net8.0 was computed.
net8.0-android
net8.0-android was computed.
net8.0-browser
net8.0-browser was computed.
net8.0-ios
net8.0-ios was computed.
net8.0-maccatalyst
net8.0-maccatalyst was computed.
net8.0-macos
net8.0-macos was computed.
net8.0-tvos
net8.0-tvos was computed.
net8.0-windows
net8.0-windows was computed.
|
NuGet packages (3)
Showing the top 3 NuGet packages that depend on PSC.Extensions:
GitHub repositories
This package is not used by any popular GitHub repositories.
Collection of useful functions as extensions for .NET 5.0