假如我開始了與同步版本:當處置WCF對象與異步模式
using(var svc = new ServiceObject()) {
var result = svc.DoSomething();
// do stuff with result
}
我風與
var svc = new ServiceObject();
svc.BeginDoSomething(async => {
var result = svc.EndDoSomething(async);
svc.Dispose();
// do stuff with result
},null);
1)這是正確的地方調用Dispose() ?
2)有沒有辦法使用()?
@Johann Blais,謝謝你審查答案。 – 2015-04-01 11:58:56