make it singleton and put into the cache
something like
public class CachedLogic
{
private static CachedLogic m_instance;
public static CachedLogic Instance
{
get
{
if ( m_instance == null)
m_instance = new CachedLogic();
return ( m_instance );
}
}
}
And then in the Web page or in the Web Service you can use Application cache
e.g
CachedLogic logic;
logic = Application["MyCachedLo gic"] ;
if ( logic == null )
{
logic = CachedLogic.Ins tance;
this.Applicatio n["MyCachedLo gic"] = logic;
}
"davidw" <da****@affinis ys.com> wrote in message
news:eQ******** ******@tk2msftn gp13.phx.gbl...
I created my own WebControl, I am thinking a way to put some logics in the
class to a seperated class, and it will be accessed by all instances of my
WebControl, the idea is that the class doesn;t need to be created
everytime, and data in it can be retrieved from database one time only. What can I
achieve this? static method in class? multi-thread class? or cache?
Thanks