protected override void InsertUserHistory(AuthenticationHistory history)
{
using (var cn = new SqlConnection(ConnectionStringAudit))
{
cn.Open();
using (var cmd = new SqlCommand())
{
cmd.Connection = cn;
cmd.CommandType = System.Data.CommandType.Text;
cmd.CommandText = @"insert into Security.AuthenticationHistory
(UserName, IpAddress, IsAuthenticated)
Values (@UserName, @IpAddress, @IsAuthenticated)";
cmd.Parameters.AddWithValue("UserName", history.UserName);
cmd.Parameters.AddWithValue("IpAddress", history.IPAddress);
cmd.Parameters.AddWithValue("IsAuthenticated", history.IsAuthenticated);
cmd.ExecuteNonQuery();
}
}
SaveUserSession(history.UserSession);
}