PSC.Extensions 6.0.17

There is a newer version of this package available.
See the version list below for details.
dotnet add package PSC.Extensions --version 6.0.17
NuGet\Install-Package PSC.Extensions -Version 6.0.17
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="PSC.Extensions" Version="6.0.17" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add PSC.Extensions --version 6.0.17
#r "nuget: PSC.Extensions, 6.0.17"
#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 PSC.Extensions as a Cake Addin
#addin nuget:?package=PSC.Extensions&version=6.0.17

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

PureSourceCode.com Extension for .NET6

ClaimExtensions Methods

Name Description
Public method Static member GetClaim Gets a claim from a list of claims
Public method Static member GetClaimValue Gets the value of the requested claim if it exists
Public method Static member HasRole Determines whether the specified role name has role.
Public method Static member HasRoles Determines whether the specified role name has roles.
Public method Static member UpdateClaim Updates a claim with a new value

Crypto

Name Description
Public method Static member BytesToHex Byteses to hexadecimal.
Public method Static member Decrypt Decrypts the specified data.
Public method Static member Encrypt Encrypts the specified data.
Public method Static member HexToBytes Hexadecimals to bytes.
Public method Static member RandomString Randoms the string (lowercase string)

DateExtensions Methods

Name Description
Public method Static member AscensionDay Calculate Ascencion day
Public method Static member AshWednesday Calculate Ash Wednesday
Public method Static member ChristmasDay Get the first day of christmas
Public method Static member DateDiff Dates the difference.
Public method Static member EasterSunday Calculate Easter Sunday day
Public method Static member FirstSundayOfAdvent Calculate the first Sunday of Advent
Public method Static member GetRandomDateTime Generate random DateTime between range
Public method Static member GoodFriday Calculate Good Friday
Public method Static member PalmSunday Calculate Palm Sunday
Public method Static member WhitSunday Calculate Whit Sunday

EnumerableExtensions Methods

Name Description
Public method Static member PickRandom<T>(IEnumerable<T>) Return a random item for an IEnumerable T
Public method Static member PickRandom<T>(IEnumerable<T>, Int32) Return a random item for an IEnumerable T
Public method Static member Shuffle<T>) Return source ordered by a new Guid

EnumExtension Methods

Name Description
Public method Static member GetLocalizedDescription Gets localized description
Public method Static member GetDescription<T> Gets the description.
Public method Static member ToEnum<T>(String) Extension method to return an enum value of type T for the given string.
Public method Static member ToEnum<T>(Int32) Extension method to return an enum value of type T for the given int.

ExpressionExtensions Methods

Name Description
Public method Static member And<T> Combines the first predicate with the second using the logical "and".
Public method Static member BuildPredicate<T> Builds the predicate.
Public method Static member Not<T> Negates the predicate.
Public method Static member Or<T> Combines the first predicate with the second using the logical "or".
Public method Static member Replace Replaces the specified search ex.

JsonSerializationExtension Methods

Name Description
Public method Static member ReadFromJsonFile<T> Reads an object instance from an Json file. Object type must have a parameterless constructor.
Public method Static member 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
Public method Static member TrimSpace Remove spece for each element of a list of string

NUmberExtensions Methos

Name Description
Public method Static member Truncate Truncate a decimal with a specific number of decimals (precision) [Fast and universal version]
Public method Static member Truncate Truncate a decimal with a specific number of decimals (precision) [Using Math.Pow()]

StringExtensions Methods

Name Description
Public method Static member CheckIPValid Checks the ip valid.
Public method Static member ExtractDomainNameFromURL Extract a domain name from a full URL
Public method Static member GetLast Gets the last.
Public method Static member IPToNumber Gets a number from a IPv4
Public method Static member IsDate Determines whether the specified date is date.
Public method Static member IsNumeric Is the numeric.
Public method Static member PadNumber Pads the number.
Public method Static member RandomString Returns a random string with random alphanumeric characters
Public method Static member RemoveSpecialCharacter Replace special character with another string
Public method Static member ReplaceSpace Replace spaces with another string
Public method Static member ReplaceSpecialCharacters Replace non-ASCII characters with their ASCII value
Public method Static member Right Return the last n characters from a string
Public method Static member StripHTML Remove all HTML tags from a string
Public method Static member SubstringBetween Takes a substring between two anchor strings (or the end of the string if that anchor is null)
Public method Static member TruncateString(String, Int32) Truncate a string after maxLength characters.
Public method Static member TruncateString(String, Int32, Boolean) Truncate a string after maxLength characters.

Other Blazor components

  • DataTable for Blazor: DataTable component for Blazor WebAssembly and Blazor Server
  • Markdown editor for Blazor: This is a Markdown Editor for use in Blazor. It contains a live preview as well as an embeded help guide for users.
  • Modal dialog for Blazor: Simple Modal Dialog for Blazor WebAssembly
  • PSC.Extensions: 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…
  • Quill for Blazor: Quill Component is a custom reusable control that allows us to easily consume Quill and place multiple instances of it on a single page in our Blazor application
  • Segment for Blazor: This is a Segment component for Blazor Web Assembly and Blazor Server
  • Tabs for Blazor: This is a Tabs component for Blazor Web Assembly and Blazor Server

More examples and documentation

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  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 (3)

Showing the top 3 NuGet packages that depend on PSC.Extensions:

Package Downloads
PSC.Blazor.Components.DataTable

DataTable for Blazor (.NET5) For the full list of properties and example, please visit https://www.puresourcecode.com/dotnet/net-core/datatable-component-for-blazor/

PSC.Blazor.Components.CodeSnippet

Show your code nicely

PSC.Blazor.Components.WorldMap

WorldMap for Blazor

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
6.0.32 133 10/4/2023
6.0.31 100 9/15/2023
6.0.30 257 2/13/2023
6.0.29 208 2/13/2023
6.0.28 590 5/24/2022
6.0.25 492 2/24/2022
6.0.24 388 2/24/2022
6.0.22 382 2/24/2022
6.0.20 399 1/27/2022
6.0.19 6,010 1/13/2022
6.0.18 252 12/7/2021
6.0.17 240 12/7/2021
6.0.16 5,410 11/17/2021
1.0.2 1,351 10/1/2021

Collection of useful functions as extensions for .NET 6.0