AGDevX 0.0.1-alpha

This is a prerelease version of AGDevX.
dotnet add package AGDevX --version 0.0.1-alpha
NuGet\Install-Package AGDevX -Version 0.0.1-alpha
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="AGDevX" Version="0.0.1-alpha" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AGDevX --version 0.0.1-alpha
#r "nuget: AGDevX, 0.0.1-alpha"
#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 AGDevX as a Cake Addin
#addin nuget:?package=AGDevX&version=0.0.1-alpha&prerelease

// Install AGDevX as a Cake Tool
#tool nuget:?package=AGDevX&version=0.0.1-alpha&prerelease

AGDevX .NET

AGDevX .NET is a collection of C# extension methods, utilities, and other helpful, foundational code that can help make developing applications more elegant.

<br /> <br />

Features

The sections below describe AGDevX .NET's capabilities.

Assemblies

Assembly Extensions

  • FullNameStartsWithPrefix: Determines if an assembly's FullName begins with the provided string prefix
  • FullNameStartsWithPrefixes: Determines if an assembly's FullName begins with any of the provided string prefixes

Assembly Utility

  • GetAssemblies: Recursively retrieves all assemblies referenced by the provided parent assembly or the currently executing assembly
  • AssemblyNameStartsWithAnyPrefix: Determines if an assembly's FullName begins with any of the provided prefixes

<br />

Attributes

Attribute Extensions

  • GetDescription: Retrieves the value of the DescriptionAttribute for an objects of type T

<br />

DateTimes

DateTime Extensions

  • SpecifyKind: Specifies the Kind of the DateTime

<br />

Enums

Enum Extensions

  • IsOneOf: Determines if an Emum exists in a list of Enums

EnumStringValueAttribute

Decorator to provide a string value to an Enum since C# does not support Enums with a string value

  • StringValue (extension): Retrieves the string value for an Enum decorated with the EnumStringValueAttribute

<br />

Exceptions

  • CodedException: Base exception from which to inherit for application-specific exceptions. This inherits from ApplicationException and adds the concept of a "Code" that can be programmatically checked by other applications if this exception is serialized and returned to another application.

  • AcquireTokenException: Exception to throw if an error occurs while acquiring a token from an authorization server

  • ApplicationStartupException: Exception to throw during application start up if an error occurs during the application startup process

  • ClaimNotFoundException: Exception to throw if a claim is unable to be retrieved from a ClaimsPrincipal

  • ExtensionMethodException: Exception to throw if an error occurs during the execution of an extension method when no other more-specific exceptions are available

  • ExtensionMethodParameterNullException: Exception to throw if a required parameter was not provided to an extension method

  • MissingRequiredClaimException: Exception to throw if a required Claim is missing from a ClaimsPrincipal

  • NotAuthorizedException: Exception to throw if the ClaimsPrincipal is attempting to access a resource or perform a function that it is not allowed to

Exception Detail

Information relevant to a developer that has been extracted from an execption and put into an easy to consume model

  • GetExceptionDetail (Exception extension method): Recursively retrieves structured information about an exception

<br />

Guids

Guid Extensions

  • IsEmpty: Determines if a Guid is empty
  • IsNotEmpty: Determines if a Guid is not empty
  • IsNull: Determines if a Guid is null
  • IsNotNull: Determines if a Guid is not null
  • IsNullOrEmpty: Determines if a Guid is null or empty
  • IsNotNullNorEmpty: Determines if a Guid is not null and not empty

<br />

IEnumerables

Dictionary Extensions

  • ReverseKeysAndValues: Switches the place of the Dictionary's Keys and Values
  • Concatenate: Appends one Dictionary to another

IEnumerable Extensions

  • IsNullOrEmpty: Determines if an IEnumerable is null or empty
  • HasCommonStringElement: Determines if two string IEnumerables have a common element
  • ToDataTable: Converts an IEnumerable of type T to a DataTable with the provided column name
  • ContainsIgnoreCase: Determines if a string IEnumerable contains the provided string
  • AnySafe: Determines if there are any records in an IEnumerable (will not blow up on null IEnumerables)

<br />

Objects

Object Extensions

  • IsNull: Determines if an object is null
  • IsNotNull: Determines if an object is not null

<br />

Security

  • Auth0ClaimType: Claim Types as defined by Auth0
  • CustomClaimType: Claim Types as defined by AGDevX
  • JwtClaimType: Standard JWT Claim Types

ClaimsPrincipal Extensions

Extensions for pulling Claims out of a ClaimsPrincipal

<br />

Strings

String Extensions

  • EqualsIgnoreCase: Determines if two string are equal ignoring case
  • StartsWithIgnoreCase: Determines if a string starts with another string ignoring case
  • ContainsIgnoreCase: Determines if a string is contained within another string ignoring case
  • IsNullOrWhiteSpace: Determines if a string is null or whitespace
  • IsNotNullNorWhiteSpace: Determines if a string is not null and not whitespace
  • IsWhiteSpace: Determines if a string only consists of whitespace
  • IsNotWhiteSpace: Determines if a string contains at least one character that is not whitespace
  • IsEmpty: Determines if a string is empty
  • IsNotEmpty: Determines if a string is not empty

<br /> <br />

Tech Debt

  • Unit tests to cover all ClaimsPrincipal extensions (there are many)
  • Document all ClaimsPrincipal extensions (there are many)
Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  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.
  • net7.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on AGDevX:

Package Downloads
AGDevX.Web.Swagger

AGDevX Swagger .NET is a wrapper that makes configuring Swagger for .NET Core Web APIs simpler.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.0.1-alpha 104 5/21/2023

Initial release