TDiscover 0.0.0
dotnet add package TDiscover --version 0.0.0
NuGet\Install-Package TDiscover -Version 0.0.0
<PackageReference Include="TDiscover" Version="0.0.0" />
paket add TDiscover --version 0.0.0
#r "nuget: TDiscover, 0.0.0"
// Install TDiscover as a Cake Addin #addin nuget:?package=TDiscover&version=0.0.0 // Install TDiscover as a Cake Tool #tool nuget:?package=TDiscover&version=0.0.0
tdiscover
A .Net library to help speed up and simplify type discovery.
Overview
tdiscover simplifies type discovery overhead when searching through .Net assemblies with a bunch of helpful methods to speed up your development.
Prerequisities
tdiscover
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 TDiscover
package.
dotnet add package TDiscover
Examples
Search for a derived type by its root.
using System.Reflection;
using TDiscover;
public record AggregateRoot;
public record OrderAggregate : AggregateRoot;
var assembly = Assembly.GetExecutingAssembly();
var type = Td.FindByAsse<AggregateRoot>(assembly);
// or typeof(AggregateRoot).FindByAsse(assembly);
Use FindByCallingAsse()
to start from 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;
Td.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;
Td.FindByTypeName<DomainEvent>("OrderPlaced");
// or typeof(DomainEvent).FindByTypeName("OrderPlaced");
Search for a type when all you have is the type name.
Td.FindByTypeName("OrderPlaced");
Give us a ⭐
If you are an assembly and typing guru, give tdiscover a star. 💜
License
This project is licensed under the terms of MIT license.
Product | Versions 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. |
-
net8.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on TDiscover:
Package | Downloads |
---|---|
EventStorage
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 |
---|---|---|
0.0.0 | 297 | 10/10/2024 |
0.0.0-alpha | 82 | 10/9/2024 |