Is it possible to call an instance method from a static constructor in WCF service? Is there something like current context through which I can get the current instance of MyService?
public class MyService : IMyService
{
static MyService()
{
//how to call Func?
}
private void Func()
{
}
}
EDIT:
This question is WCF question, not a simple language one about calling an instance method from a static one. Here is an example of similar case in web application:
public class MyPage : Page
{
static MyPage()
{
var page = (MyPage)HttpContext.Current.Handler;
page.Func();
}
private void Func()
{
}
}
So I expect that in WCF while a call to a service exist some global context that has the currently executing instance of MyService.