public void Execute(LogFailedLoginAttemptCommand command, IExecutionContext executionContext)
        {
            var connectionInfo = _clientConnectionService.GetConnectionInfo();

            _sqlExecutor.ExecuteCommand("Cofoundry.FailedAuthticationAttempt_Add",
                                        new SqlParameter("UserAreaCode", command.UserAreaCode),
                                        new SqlParameter("Username", TextFormatter.Limit(command.Username, 150)),
                                        new SqlParameter("IPAddress", connectionInfo.IPAddress),
                                        new SqlParameter("DateTimeNow", executionContext.ExecutionDate)
                                        );
        }
        public void Execute(LogAuthenticatedUserInCommand command, IExecutionContext executionContext)
        {
            var user = Query(command.UserId).SingleOrDefault();

            EntityNotFoundException.ThrowIfNull(user, command.UserId);

            var connectionInfo = _clientConnectionService.GetConnectionInfo();

            SetLoggedIn(user, executionContext);
            _dbContext.SaveChanges();

            _sqlExecutor.ExecuteCommand("Cofoundry.UserLoginLog_Add",
                                        new SqlParameter("UserId", user.UserId),
                                        new SqlParameter("IPAddress", connectionInfo.IPAddress),
                                        new SqlParameter("DateTimeNow", executionContext.ExecutionDate)
                                        );
        }