AsyncHandler.Assembly 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package AsyncHandler.Assembly --version 1.0.0                
NuGet\Install-Package AsyncHandler.Assembly -Version 1.0.0                
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="AsyncHandler.Assembly" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AsyncHandler.Assembly --version 1.0.0                
#r "nuget: AsyncHandler.Assembly, 1.0.0"                
#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 AsyncHandler.Assembly as a Cake Addin
#addin nuget:?package=AsyncHandler.Assembly&version=1.0.0

// Install AsyncHandler.Assembly as a Cake Tool
#tool nuget:?package=AsyncHandler.Assembly&version=1.0.0                

AsyncHandler.Assembly

.Net assembly scanning and type discovery made simplified.

Github follow Nuget Package Nuget Github follow

<div align="left"> <img src=".assets/ah_radius.PNG" width="80" height="80" style="float:left;" alt="asynchandler"> </div>

Overview

AsyncHandler.Assembly simplifies the process of searching through .Net assemblies when targeting a specific type, with a bunch of helpful static and extensions methods to help speed up development.

Prerequisities

My Skills

The library runs on the stable release of .Net 8 and requires the SDK installed:

https://dotnet.microsoft.com/en-us/download/dotnet/8.0

Install the package

Iinstall AsyncHandler.Assembly package.

dotnet add package AsyncHandler.Assembly

Examples

Search for a derived type with its root.

using System.Reflection;
using AsyncHandler.Assembly;

public record AggregateRoot;
public record OrderAggregate : AggregateRoot;

var assembly = Assembly.GetExecutingAssembly();
var type = TDiscover.FindByAsse<AggregateRoot>(assembly);
// or typeof(AggregateRoot).FindByAsse(Assembly.GetExecutingAssembly());

Search for a type using calling assembly all the way back to matching assembly. FindByCallingAsse() offers significant performance gains.

typeof(AggregateRoot).FindByCallingAsse(Assembly.GetCallingAssembly());

Search for a type through AppDomain, smart tricks and filters are applied to enhance the search.

public record DomainEvent;
public record OrderPlaced : DomainEvent;

TDiscover.FindByType<DomainEvent>();

To further enhance the above search, use FindByTypeName to specify the type and name as well.

public record DomainEvent;
public record OrderPlaced : DomainEvent;
public record OrderConfirmed : DomainEvent;

TDiscover.FindByTypeName<DomainEvent>("OrderPlaced");
// or typeof(OrderPlaced).FindByTypeName("OrderPlaced");

Search for a type when all you have is the type name.

TDiscover.FindByTypeName("OrderPlaced");

Give us a ⭐

If you are an event sourcer and love OSS, give AsyncHandler.Assembly a star. 💜

License

This project is licensed under the terms of the MIT license.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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.
  • net8.0

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on AsyncHandler.Assembly:

Package Downloads
AsyncHandler.EventSourcing

A lightweight event sourcing framework with event storage of choice.

NewWorkflows

A lightweight event sourcing framework with event storage of choice.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.0 340 9/14/2024
1.0.1 109 9/13/2024
1.0.0 101 9/12/2024