drn-utils

Centralizes DI registration, configurable via IAppSettings and structured logging for DRN projects.

20|3|Updated Aug 13, 2023
One-click install
npx skills add https://github.com/duranserkan/DRN-Project --skill drn-utils
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: drn-utils
Source: https://github.com/duranserkan/DRN-Project/tree/main/.agent/skills/drn-utils
Command: npx skills add https://github.com/duranserkan/DRN-Project --skill drn-utils

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

DRN.Framework.Utils provides a cohesive core infrastructure to simplify service registration (DI), configuration retrieval, and cross-cutting concerns like logging, enabling consistent patterns across DRN packages.

Core Features & Use Cases

  • Attribute-based DI with Scoped, Singleton, Transient, and keyed variants.
  • Configuration access via IAppSettings and [Config]-based binding.
  • Central logging abstractions and extension methods for structured logs.
  • Common utilities and extensions used by multiple DRN packages.
  • Use Case: Quickly register services via attributes, access configuration, and instrument code with scoped logs.

Quick Start

Install the DRN.Utils package in your project, then call AddDrnUtils() in your DI setup and start using IAppSettings and IScopedLog in your services.

Frequently Asked Questions about drn-utils

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I register services for dependency injection using attributes?

Attribute-based dependency injection allows you to register services as Scoped, Singleton, or Transient directly via attributes. You call AddDrnUtils() during setup to automatically wire up these attributed classes.

How does configuration binding work with IAppSettings?

Configuration binding with IAppSettings allows you to retrieve application settings programmatically. You can also use the [Config] attribute to bind specific configuration sections to strongly typed objects.

Can I use attribute-based dependency injection across different hosting scenarios?

Yes, this infrastructure supports consistent service registration and configuration access across multiple hosting scenarios. It provides a cohesive core for any module requiring scoped logs and dependency injection.

What is the best way to implement structured logging alongside service registration?

To implement structured logging, use the central logging abstractions and extension methods provided. After calling AddDrnUtils(), inject and utilize IScopedLog within your services to instrument code.

Does this utility module support keyed dependency injection variants?

Yes, the attribute-based dependency injection system explicitly supports keyed service variants. This allows for precise service resolution alongside standard Singleton, Transient, and Scoped registrations.

Why do I need a central utils module for cross-cutting concerns?

A central utils module provides a cohesive infrastructure to simplify service registration, configuration retrieval, and logging. This ensures consistent patterns and cross-cutting concern handling across multiple packages.