I have this code:
class ServiceConsumer
{
static void Main(string[] args)
{
//call from here retriveEvents method evry 5 minutes!
}
private static void retriveEvents()
{
IContract proxy = ChannelFactory<IContract>.CreateChannel(new BasicHttpBinding(),
new EndpointAddress("http://someAddress/Hydrant.svc"));
using (proxy as IDisposable)
{
var rows = proxy.GetData(new DateTime(2000, 5, 1));
}
}
}
The retriveEvents() method is creating proxy and retrieve data from host service. How can I call asyncroniusly retriveEvents() method to access host service evry 5 minutes?