我面临着不同的问题,我的代码如下:
private void context_AuthRequest(object sender, EventArgs e)
{
MyPrincipal principal = null;
MyClient getClient = new MyClientService().GetByClientID(Instance.ClientID.Value);
Guid? userAuthTicketID = GetUserAuthenticationTicketID();
if (userAuthTicketID.HasValue)
{
principal = GetPrincipal(userAuthTicketID.Value);
}
if (principal != null)
{
//delay for first time approximately to 8 sec
HttpContext.Current.User = principal;
System.Threading.Thread.CurrentPrincipal = principal;
}
else
{
//delay for first time approximately to 8 sec
}
}
你能帮我解释为什么会有延迟