我试图在一个方法中调用一个回调合约方法,该方法在某个事件被触发时被调用。但是当我试图获取 OperationContext.Current 时出现异常。只有在触发此事件时,我才能调用回调方法。
private void recordInserted() //This method is called when the event is fired
{
ICallbackContract callback = OperationContext.Current.GetCallbackChannel<ICallbackContract>();
callback.insertsuccessful();
}