PSC.Extensions
6.0.32
dotnet add package PSC.Extensions --version 6.0.32
NuGet\Install-Package PSC.Extensions -Version 6.0.32
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.32" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add PSC.Extensions --version 6.0.32
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: PSC.Extensions, 6.0.32"
#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.32 // Install PSC.Extensions as a Cake Tool #tool nuget:?package=PSC.Extensions&version=6.0.32
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
PureSourceCode.com Extension for .NET6
ClaimExtensions Methods
Name | Description | |
---|---|---|
GetClaim | Gets a claim from a list of claims | |
GetClaimValue | Gets the value of the requested claim if it exists | |
HasRole | Determines whether the specified role name has role. | |
HasRoles | Determines whether the specified role name has roles. | |
UpdateClaim | Updates a claim with a new value |
Crypto
Name | Description | |
---|---|---|
BytesToHex | Bytes to hexadecimal. | |
Decrypt | Decrypts the specified data. | |
Encrypt | Encrypts the specified data. | |
HexToBytes | Hexadecimals to bytes. | |
RandomString | Randoms the string (lowercase string) |
DateExtensions Methods
Name | Description | |
---|---|---|
AscensionDay | Calculate Ascension day | |
AshWednesday | Calculate Ash Wednesday | |
ChristmasDay | Get the first day of Christmas | |
DateDiff | Dates the difference. | |
EasterSunday | Calculate Easter Sunday day | |
FirstSundayOfAdvent | Calculate the first Sunday of Advent | |
GetRandomDateTime | Generate random DateTime between range | |
GoodFriday | Calculate Good Friday | |
PalmSunday | Calculate Palm Sunday | |
WhitSunday | Calculate Whit Sunday | |
StartOfTheDay | Return the midnight for a date | |
EndOfTheDay | Return the midnight -1 second for a date |
EnumerableExtensions Methods
Name | Description | |
---|---|---|
PickRandom<T>(IEnumerable<T>) | Return a random item for an IEnumerable T | |
PickRandom<T>(IEnumerable<T>, Int32) | Return a random item for an IEnumerable T | |
Shuffle<T>) | Return source ordered by a new Guid |
EnumExtension Methods
Name | Description | |
---|---|---|
GetLocalizedDescription | Gets localized description | |
GetDescription<T> | Gets the description. | |
GetDescription<T> | Gets the description from the name of an enum item | |
ToEnum<T>(String) | Extension method to return an enum value of type T for the given string. | |
ToEnum<T>(Int32) | Extension method to return an enum value of type T for the given int. |
ExpressionExtensions Methods
Name | Description | |
---|---|---|
And<T> | Combines the first predicate with the second using the logical "and". | |
BuildPredicate<T> | Builds the predicate. | |
Not<T> | Negates the predicate. | |
Or<T> | Combines the first predicate with the second using the logical "or". | |
Replace | Replaces the specified search ex. |
JsonSerializationExtension Methods
Name | Description | |
---|---|---|
ReadFromJsonFile<T> | Reads an object instance from an Json file. Object type must have a parameterless constructor. | |
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 | |
---|---|---|
TrimSpace | Remove spece for each element of a list of string |
NumberExtensions Methos
Name | Description | |
---|---|---|
Distribute | Proportionately distribute prorate a value across a set of values | |
GetListOfRandomDoubles | Returns a list of countOfNumbers values with a number of digits that the sum is totalSum |
|
IsDecimal | Check if a number is a decimal | |
IsInteger | Check if a number is an integer | |
RedistributePercentageTotal | Check and adopt a list of decimal value to have a precise sum. Ideal for percentage. | |
Truncate | Truncate a decimal with a specific number of decimals (precision) [Fast and universal version] | |
Truncate | Truncate a decimal with a specific number of decimals (precision) [Using Math.Pow()] |
StringExtensions Methods
Name | Description | |
---|---|---|
Base64Encode | Encode a plain text string in a string Base64. | |
Base64Decode | Decode a string Base64 in plain text. | |
CheckIPValid | Checks the ip valid. | |
ExtractDomainNameFromURL | Extract a domain name from a full URL | |
GetApplicationRoot | Gets the application root from a file path removing file:\\ |
|
GetLast | Gets the last. | |
IPToNumber | Gets a number from a IPv4 | |
IsDate | Determines whether the specified date is date. | |
IsNumeric | Is the numeric. | |
IsValidEmail | Check if it is a valid email | |
PadNumber | Pads the number. | |
RandomString | Returns a random string with random alphanumeric characters | |
RemoveSpecialCharacter | Replace special character with another string | |
ReplaceSpace | Replace spaces with another string | |
ReplaceSpecialCharacters | Replace non-ASCII characters with their ASCII value | |
Right | Return the last n characters from a string | |
StripHTML | Remove all HTML tags from a string | |
SubstringBetween | Takes a substring between two anchor strings (or the end of the string if that anchor is null) | |
TruncateString(String, Int32) | Truncate a string after maxLength characters. | |
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
- Write a reusable Blazor component
- Getting Started With C# And Blazor
- Setting Up A Blazor WebAssembly Application
- Working With Blazor Component Model
- Secure Blazor WebAssembly With IdentityServer4
- Blazor Using HttpClient With Authentication
- InputSelect component for enumerations in Blazor
- Use LocalStorage with Blazor WebAssembly
- Modal Dialog component for Blazor
- Create Tooltip component for Blazor
- Consume ASP.NET Core Razor components from Razor class libraries | Microsoft Docs
Product | Versions 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.
-
net6.0
- Newtonsoft.Json (>= 13.0.2)
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 | 251 | 10/4/2023 |
6.0.31 | 136 | 9/15/2023 |
6.0.30 | 290 | 2/13/2023 |
6.0.29 | 245 | 2/13/2023 |
6.0.28 | 630 | 5/24/2022 |
6.0.25 | 535 | 2/24/2022 |
6.0.24 | 419 | 2/24/2022 |
6.0.22 | 417 | 2/24/2022 |
6.0.20 | 430 | 1/27/2022 |
6.0.19 | 9,526 | 1/13/2022 |
6.0.18 | 283 | 12/7/2021 |
6.0.17 | 269 | 12/7/2021 |
6.0.16 | 7,002 | 11/17/2021 |
1.0.2 | 1,470 | 10/1/2021 |
Collection of useful functions as extensions for .NET 6.0