Skip to content

Useful extensions for .net framework types. This is a pure utility package and should be kept as simple as possible but also as powerful as possible :)

License

Notifications You must be signed in to change notification settings

acme-be/Acme.Core.Extensions

Repository files navigation

Acme.Core.Extensions

Useful extensions for .net framework types. This is a pure utility package and should be kept as simple as possible but also as powerful as possible :)

NuGet Package NuGet Package License

Getting started

Install NuGet Package Acme.Core.Extensions from Package Manager or from Package Manager Console:

PM> Install-Package Acme.Core.Extensions

After installation you have access to a new namespace :

using Acme.Core.Extensions;

Changes

2.0.0

  • Add a method ThrowIfZero
  • Downgrade reference to StyleCop.Analyzers to 1.0.2

1.3.0

  • Add a method SecurityHelper.CreateCryptographicallySecureGuid

1.2.1

  • Change the Exception from EnsureNotNull to a ObjectIsNullException to avoid confusion with the ParameterNullException.

1.2.0

  • Added DateTimeExtensions.DateOrNull
  • Added ObjectExtensions.ExecuteOrNull

1.1.0

  • Added StringExtensions.ReplaceSpecialChars

1.0.0

  • Added ByteArrayExtensions.ToHexadecimalString
  • Added DateTimeExtensions.ToUnixTimeStamp
  • Added ObjectExtensions.EnsureNotNull
  • Added ObjectExtensions.ThrowIfNull

Roadmap & Ideas

  • Unit tests to keep a coverage above 80%
  • Keep library compatible with .Net Framework, .Net Core and .Net Standard
  • Avoid too many references to external libraries

Related Projects

Acme.Web.Security.Headers

Secure your web site/application with a simple package.

https://github.com/olibos/Acme.Web.Security.Headers

Documentation

All the library is self documented with XmlDoc, but here you can find some code sample. You can also have a look at the unit test project, it contains most of the extensions and how to use it.

ByteArrayExtensions

  • ToHexadecimalString : Convert a byte array into his hexadecimal string

DateTimeExtensions

  • DateOrNull : Returns the Date property of the object of the date is not null. Otherwise, returns null.
  • ToUnixTimeStamp : Convert a datetime to a UNIX timestamp (i.e. : number of seconds since unix Epoch)

ObjectExtensions

StringExtensions

  • ReplaceSpecialChars : Remove all special chars and accent from a string, can also replace spaces with '-'
  • SHA512 : Generate a SHA512 from the string.

SecurityHelper

  • CreateCryptographicallySecureGuid : Create a guid that is secure and not predictable.

About

Useful extensions for .net framework types. This is a pure utility package and should be kept as simple as possible but also as powerful as possible :)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages