DKNet

DKNet.Fw.Extensions

Reflection, type discovery and small value helpers for .NET developers who need reusable in-process operations.

✨ Why use it?

πŸš€ Quick Start

Use a .NET 10 console project. Install the package, then replace Program.cs with the example.

dotnet new console -f net10.0 -n CoreDemo
cd CoreDemo
dotnet add package DKNet.Fw.Extensions
using System;
using System.Linq;
using DKNet.Fw.Extensions.TypeExtractors;

var types = typeof(Worker).Assembly.Extract()
    .Classes().NotAbstract().IsInstanceOf<IWorker>().ToList();
Console.WriteLine(types.Contains(typeof(Worker))); // True

public interface IWorker { }
public sealed class Worker : IWorker { }

Run with dotnet run.

πŸ—οΈ Architecture

The caller uses DKNet.Fw.Extensions helpers inside its process, with the .NET APIs and shared metadata they depend on.

All helpers run synchronously in the caller’s process. Assembly type arrays and property metadata are shared through static concurrent dictionaries; query predicates and object values remain specific to each call or extractor. The project references DI abstractions and component-model annotations; no service registration or background worker is required.

πŸ”„ How it works

Extract creates a lazy type query, filters narrow it, and enumeration retrieves assembly types before returning the matching implementations.

Extract rejects a null or empty assembly array and removes duplicates. Filters build independent predicate chains; enumeration loads or reuses cached assembly types, then evaluates those predicates in order. Type loading and predicate exceptions propagate to the caller.

🧩 Features