Merq.DependencyInjection 2.0.0-alpha

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

// Install Merq.DependencyInjection as a Cake Tool
#tool nuget:?package=Merq.DependencyInjection&version=2.0.0-alpha&prerelease                
var builder = WebApplication.CreateBuilder(args);
...
// Automatically add the message bus and all command handlers and 
// event producers in the current project and any dependencies
// The enableAutoMapping parameter enables duck typing for events and commands
// across assemblies
builder.Services.AddMessageBus(enableAutoMapping: false);

The AddMessageBus extension method leverages compile-time code generation to avoid negatively impacting run-time app startup, via the dependency on Devlooped.Extensions.DependencyInjection.Attributed. This also ensures that all proper service interfaces are registered for the various components.

Duck Typing Support

Being able to loosely couple both events (and their consumers) and command execution (from their command handler implementations) is a key feature of Merq. To take this decoupling to the extreme, Merq allows a similar capability as allowed by the TypeScript/JavaScript in VSCode: you can just copy/paste an event/command definition as source into your assembly, and perform the regular operations with it (like Observe an event and Execute a command), in a "duck typing" manner.

As long as the types' full name match, the conversion will happen automatically. Since this functionality isn't required in many scenarios, and since there are a myriad ways to implement such an object mapping functionality, the Merq.Core package only provides the hooks to enable this, but does not provide any built-in implementation for it.

The Merq.AutoMapper package provides one such implementation, based on the excelent AutoMapper library.

Dogfooding

CI Version Build

We also produce CI packages from branches and pull requests so you can dogfood builds as quickly as they are produced.

The CI feed is https://pkg.kzu.io/index.json.

The versioning scheme for packages is:

  • PR builds: 42.42.42-pr[NUMBER]
  • Branch builds: 42.42.42-[BRANCH].[COMMITS]

Sponsors

Clarius Org Christian Findlay C. Augusto Proiete Kirill Osenkov MFB Technologies, Inc. SandRock Andy Gocke Shahzad Huq

Sponsor this project  

Learn more about GitHub Sponsors

For usage and authoring of commands and events, see Merq readme.

Sponsors

Clarius Org Christian Findlay C. Augusto Proiete Kirill Osenkov MFB Technologies, Inc. SandRock Andy Gocke Shahzad Huq

Sponsor this project  

Learn more about GitHub Sponsors

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.0.0 330 1/29/2024
2.0.0-rc.6 534 1/29/2024
2.0.0-rc.5 60 1/27/2024
2.0.0-rc.3 488 7/10/2023
2.0.0-rc.2 103 7/10/2023
2.0.0-rc.1 97 7/7/2023
2.0.0-beta.4 87 7/6/2023
2.0.0-beta.3 115 11/19/2022
2.0.0-beta.2 112 11/18/2022
2.0.0-alpha 207 11/16/2022