-
Notifications
You must be signed in to change notification settings - Fork 3
requests
James Crosswell edited this page Apr 3, 2016
·
1 revision
A request message in Command Routing is just a plain old CLR object (POCO).
Probably the easiest way to understand this if you're not familiar with CQRS is by analogy to MVC Action methods. So in ASP.NET MVC you might have an action method that takes two parameters:
public class SignInController
{
public IActionResult SignIn(string username, string password)
{
// blah blah blah
}
}In Command Routing you would instead have a Request class with two properties:
public class SignInRequest {
public string Username { get; set; }
public string Password { get; set; }
}One of the advantages of this approach is that it makes it much easier to create generic actions that can be performed on requests... such as Request Handlers ::smiley::.