Giter Club home page Giter Club logo

psc.extensions's Introduction

PureSourceCode.com Extension for .NET5

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
Public method Static Method 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(IEnumerable) Return a random item for an IEnumerable T
Public method Static member PickRandom(IEnumerable, Int32) Return a random item for an IEnumerable T
Public method Static member Shuffle) Return source ordered by a new Guid

EnumExtension Methods

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

ExpressionExtensions Methods

Name Description
Public method Static member And Combines the first predicate with the second using the logical "and".
Public method Static member BuildPredicate Builds the predicate.
Public method Static member Not Negates the predicate.
Public method Static member Or 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 Reads an object instance from an Json file. Object type must have a parameterless constructor.
Public method Static member WriteToJsonFile 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

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.

psc.extensions's People

Contributors

erossini avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.