Giter VIP home page Giter VIP logo

dotnetxtensions's Introduction

DotNetXtensions

DotNetXtensions is a general purpose toolbox of helpful .NET functions, extensions methods, and types. See corresponding nugets.

Per project documentation

(Just a brief sampling of documentation for just a few of the projects follows for the moment)

DotNetXtensions

The core project, which is mostly made of extension methods on common .NET types, while trying to avoid any too specialized use cases.

See XString for example, with its many helpful string extension methods, such as the following (note that the default behavior for these kind of core extension methods is that they are null tolerant):

  • str.SubstringMax(12) // if str.Length >= 12, return str, else take a substring of first 12 chars. This helps because string.Substring of course throws an exception if your maxLength is over str.Length. Without these you would need a couple extra lines every time
  • str.NullIfEmpty() // Return null if the string is already empty ("")
  • str.TrimIfNeeded() // highly performant, returns same string if didn't need trimmed, no unnecessary allocs!!
  • str.NullIfEmptyTrimmed() (combines TrimIfNeeded and NullIfEmpty)
  • str.StartsWithIgnoreWhite() // string.StartsWith that ignores initial whitespace

DotNetXtensions.Cryptography

Contains both encryption and compression members, providing quick and easy extension methods on strings and byte arrays. For instance str.GetSHA() and str.GetSHAString() (with hex string result), str.CompressToBase64() (DeflateStream compression), and types like:

  • CryptoRandom
  • RandomStringGenerator
  • RandomNumbers

DotNetXtensions.Net

See for instance XHttp.GetAsync which returns a HttpResponseInfo. This allows one to easily make 304 NotModified requests, as well as to easily get back ETags and so forth (see parameter HttpNotModifiedProperties settings).

DotNetXtensions.Json

General purpose Json functions built on Newtonsoft.Json.

DNXPrivate Compilation symbol

Sometimes it is desirable to reference just one or more .cs code files to, for instance, use in a utility project, without necessarily wanting or needing to make a full nuget dependency, nor to expose those members, especially extension methods, beyond the internal use-case. This can be facilitated in that many of the extension method classes have a DNXPrivate compilation symbol. By including DNXPrivate as a compilation symbol in the host library, you can keep the referenced code files internal only.

dotnetxtensions's People

Contributors

copernicus365 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

dotnetxtensions's Issues

Add US territories to DotNetXtensions.Globalization

Suggestion: Add the following to the USCanadaState enum:

String name Enum name Abbreviation Enum value
American Samoa American_Samoa AS 65
Guam Guam GU 66
Marshall Islands Marshall_Islands MH 67
Micronesia Micronesia FM 68
Northern Mariana Islands Northern_Mariana_Islands MP 69
Palau Palau PW 70
Puerto Rico Puerto_Rico PR 71
United States Virgin Islands US_Virgin_Islands VI 72

I'm happy to issue a PR on this myself.

Source: https://www.infoplease.com/us/postal-information/state-abbreviations-and-state-postal-codes

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.