Here is my controller...
public class AccountController : BaseController
{
[Route("Account/json_account_log_in")]
public async Task<JsonResult> json_account_log_in(ValidateUserQuery query)
{
ValidateUserDto response = await Mediator.Send(query);
// Do stuf...
}
}
And here is the query class..
public class ValidateUserQuery : IRequest<ValidateUserDto>
{
public string Username { get; set; }
public string Password { get; set; }
}
But in my controller, the query Username and Password are null.
If I remove the IRequest<ValidateUserDto>
then Username and Password are correct - but then I can't use Mediatr.
Can't I use classes that inherits from IRequest in ajax calls queries?