Allows commands to have services or dependencies provided by the CommandProcessor. For example a database command might look like this public class GetUserCommand : DbCommandBase<Use> { //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<User>("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
License
—
Deps
0
Install Size
—
Vulns
✓ 0
Published
Nov 14, 2012
$ dotnet add package CommandoNo README available.