Invalid image

Commando



Allows commands to have services or dependencies provided by the CommandProcessor.

For example a database command might look like this

public class GetUserCommand : DbCommandBase
{
//Constructor only takes the arguments necessary to run the command
public GetUserCommand(int userId)
{
this.UserId = userId;
}

public int UserId {get;set;}

public override User Execute(IDbConnection db)
{
return db.Query("Select * from User where Id = @UserId", new { UserId}, this.Transaction)
.FirstOrDefault();
}
}

The Command executor will then provide the neccessary DbProviderFactory to the command before execution.
(nb: The DbCommandBase is creating the actual connection)

Commands can all execute other commands, e.g.
this.Execute(new SendNewUserEmailCommand("Johnny", "John@doe.com"));

It is then the responsiblity of the Command Executor to provide the necessary email sending service.

More info can be found here.
http://github.com/markkemper1/Commando.

Info

Version: 2.0.0.21
Author(s): Jobping
Last Update: Wednesday, November 14, 2012
.NET Fiddle:
Project Url: http://github.com/markkemper1/Commando
NuGet Url: https://www.nuget.org/packages/Commando


Install
Install-Package Commando
dotnet add package Z.EntityFramework.Plus.EF6
paket add Commando
Commando Download (Unzip the "nupkg" after downloading)








STATS

must-have-score

1.1


avg-downloads-per-day

3


days-since-last-release

1859