Swapna

Swapna

  • NA
  • 21
  • 3.4k

caching data into a object on WCF Services

Oct 2 2012 8:38 AM

I have Demo.Business-(Class Library) | DemoData.cs Which has

public static Lookup<string, string> lookup; 
public static void ReadLookupData() 
{ 
     
var qry = ....; 
      lookup
= (Lookup<string, string>)qry.ToLookup(l => l.Name, l => l); 
}   
public static IEnumerable<string> GetFirstLookup(string name) 
{ 
     
var result = lookup[name].Where(r => r.FirstName== "AAAA"); 
     
return result; 
} 

I have WCF Services: Demo.Services which has got reference of Demo.Business(Class Library). I have a TestService(WCF Service):

 public TestService() 
 
{ 
 
} 

Now i want to call the method "ReadLookupData()" of Demo.Business from wcf services and cache the data in to "lookup"

I have got not much experience with caching. How to cache the data into lookup on WCF Services and use that lookup in all methods on Demo.Business. Thanks in advance.