![]() |
VOOZH | about |
dotnet add package LocatR --version 1.0.1.8
NuGet\Install-Package LocatR -Version 1.0.1.8
<PackageReference Include="LocatR" Version="1.0.1.8" />
<PackageVersion Include="LocatR" Version="1.0.1.8" />Directory.Packages.props
<PackageReference Include="LocatR" />Project file
paket add LocatR --version 1.0.1.8
#r "nuget: LocatR, 1.0.1.8"
#:package LocatR@1.0.1.8
#addin nuget:?package=LocatR&version=1.0.1.8Install as a Cake Addin
#tool nuget:?package=LocatR&version=1.0.1.8Install as a Cake Tool
Messaging with no dependencies.
Supports request/response, commands, queries synchronous and async with dispatching via C# generic variance.
⚠️ Important: Required NET.Framework 4.7.2 or later
You should install LocatR with NuGet:
Install-Package LocatR
Install-Package Unity.Mvc4
To reference only the contracts for LocatR, which includes:
IRequestThe 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, typeof(Startup).Assembly.GetTypes()));
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 | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET Framework | net472 net472 is compatible. net48 net48 was computed. net481 net481 was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
Summary of changes made in this release of the package.