LocatR 1.0.1.7

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

// Install LocatR as a Cake Tool
#tool nuget:?package=LocatR&version=1.0.1.7                

LocatR

NuGet NuGet

Messaging with no dependencies.

Supports request/response, commands, queries synchronous and async with dispatching via C# generic variance.

Installing LocatR

⚠️ Important: Required NET.Framework 4.7.2 or later

You should install LocatR with NuGet:

Install-Package LocatR
Install-Packag Microsoft.AspNet.WebFormsDependencyInjection.Unity

Using Contracts-Only Package

To reference only the contracts for LocatR, which includes:

  • IRequest

Basic usage

The following code demonstrates basic usage.

Add Global.asax.cs in Application_Start

using Unity;
using Unity.Injection;


var container = this.AddUnity();
container.RegisterType<ILocatR, LocatR.LocatR>(new InjectionConstructor(container));

Create Example Command

public class WtiteEventCommand: IRequest
{
    public string value { get; set; }
}

and CommandHandler

public class WtiteEventCommandHandler : IRequestHandler<WtiteEventCommand>
{
    Task IRequestHandler<WtiteEventCommand>.Handle(WtiteEventCommand request, CancellationToken cancellationToken)
    {
        return Task.CompletedTask;
    }
}

in Page

public partial class _Default : Page
{
    private readonly ILocatR _locator;
    
    public _Default(ILocatR locator)
    {
        _locator = locator;
    }

    protected async void Page_Load(object sender, EventArgs e)
    {
        await _locator.SendCommand(new WtiteEventCommand() { value = "Hello World" });
    }
}
Product Compatible and additional computed target framework versions.
.NET Framework net472 is compatible.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in 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
1.0.1.8 419 11/13/2022
1.0.1.7 394 11/13/2022
1.0.1.6 342 11/13/2022
1.0.1.4 371 11/13/2022
1.0.1.3 359 11/11/2022
1.0.1.2 339 11/11/2022
1.0.1.1 376 11/11/2022
1.0.1 404 9/16/2022
1.0.0.3 413 9/15/2022
1.0.0.2 416 9/15/2022
1.0.0.1 445 9/14/2022
1.0.0 544 9/14/2022

Summary of changes made in this release of the package.