public LoginUserCommandValidator(JoggingTrackerDbContext dbContext, ISecurityProvider securityProvider)
        {
            ArgumentChecker.CheckNotNull(new { dbContext, securityProvider });

            this.CustomAsync(async command =>
            {
                var user = await dbContext.Users
                           .Where(u => u.Username == command.Username)
                           .SingleOrDefaultAsync();

                if (user == null || !securityProvider.IsValidPassword(command.Password.Trim(), user.Password))
                {
                    return(new ValidationFailure(string.Empty, "Invalid credentials."));
                }

                return(null);
            });
        }