代码:

public class SingletonPerRequest
{
    
public static SingletonPerRequest Current
    {
        
get
        {
            
return (HttpContext.Current.Items["SingletonPerRequest"??
                (HttpContext.Current.Items[
"SingletonPerRequest"= 
                
new SingletonPerRequest())) as SingletonPerRequest;

        }
    }
}

 

 

详见:http://dotnetslackers.com/community/blogs/simoneb/archive/2006/08/21/The-ASP.NET-Singleton_2D00_per_2D00_Request-pattern.aspx

 

 

 

相关文章:

  • 2021-10-14
  • 2022-12-23
  • 2022-03-03
  • 2022-12-23
  • 2022-12-23
  • 2022-01-21
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-07-27
  • 2022-12-23
  • 2022-01-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-25
相关资源
相似解决方案