Run a method and countinue to the WebApp's lifetime
There is an application that collects news from rss of news agencies maybe like Google Reader!. 
I wanna to call a method to update my links in DB in a period of the time and it continues to the Application life time.
something like a clock !!!
without any pause

i know some info about Threading 
but the problem is :

**Where can i call my Update method?** 

I have some classes that some of them derive from others and i use to layer in my Project

i call the method in Global.asax:

  

  protected void Application_Start(object sender, EventArgs e)
    {
        Thread thread = new Thread(new ThreadStart(UpdateRss));
        thread.Start();
        Thread.Sleep(1000);
    }

    public void UpdateRss()
    {
        while (true)
        {

            using (LinkService linkSrv = new LinkService())
            {
                linkSrv.UpdateLinksFromRSS();
            }
        }
    }

and the definition of UpdateLinksFromRSS in LinkService is:

    

     public void UpdateLinksFromRSS()
    {
        List<RssInfo> q;
        using (RssService RssSrv = new RssService())
        {
            q = RssSrv.GetRssInfoes();
        }
        foreach (var item in q)
        {
            AddLink(item);
        }
    }
Honestly the problem is i have a property in BaseService that is defined like this:

     public static System.Web.Caching.Cache Cache
            {
                get { return HttpContext.Current.Cache; }
            }

when i run the project!
i got an error from this line: `return HttpContext.Current.Cache;`

i will happy if any one answer it!
thanks in advanced 



Run a method and countinue to the WebApp's lifetime
===

There is an application that collects news from rss of news agencies maybe like Google Reader!. 
I wanna to call a method to update my links in DB in a period of the time and it continues to the Application life time.
something like a clock !!!
without any pause

i know some info about Threading 
but the problem is :

**Where can i call my Update method?** 

I have some classes that some of them derive from others and i use to layer in my Project

i call the method in Global.asax:

  

  protected void Application_Start(object sender, EventArgs e)
    {
        Thread thread = new Thread(new ThreadStart(UpdateRss));
        thread.Start();
        Thread.Sleep(1000);
    }

    public void UpdateRss()
    {
        while (true)
        {

            using (LinkService linkSrv = new LinkService())
            {
                linkSrv.UpdateLinksFromRSS();
            }
        }
    }

and the definition of UpdateLinksFromRSS in LinkService is:

    

     public void UpdateLinksFromRSS()
    {
        List<RssInfo> q;
        using (RssService RssSrv = new RssService())
        {
            q = RssSrv.GetRssInfoes();
        }
        foreach (var item in q)
        {
            AddLink(item);
        }
    }
Honestly the problem is i have a property in BaseService that is defined like this:

     public static System.Web.Caching.Cache Cache
            {
                get { return HttpContext.Current.Cache; }
            }

when i run the project!
i got an error from this line: `return HttpContext.Current.Cache;`

i will happy if any one answer it!
thanks in advanced 


