public OperationResult<SomeResult> DoSomething(SomeParameters parmaters) { var operationId = _operationsManager.RegistrOperation("Do something"); var operation = new DoSomethingOperation(_operationsManager, operationId, parmaters); var handler = operation.RunAsync(); handler.WaitOne(); return DoSomethingGetResult(operationId); }
//[PrincipalPermission(SecurityAction.Demand, Authenticated = true)] public OperationStartInformation DoSomethingAsync(SomeParameters parmaters) { var operation = new DoSomethingOperation(_operationsManager, parmaters); var operationStart = operation.RunAsync(); return new OperationStartInformation { OperationId = operationStart.OperationId, IsReportingProgress = false, IsSupportingCancel = false, }; }
public OperationStartInformation DoSomethingAsync(SomeParameters parmaters) { var guid = _operationsManager.RegistrOperation("Do something"); var operation = new DoSomethingOperation(_operationsManager, guid, parmaters); operation.RunAsync(); return new OperationStartInformation { OperationGuid = guid, IsReportingProgress = false, IsSupportingCancel = false, }; }
// [PrincipalPermission(SecurityAction.Demand, Authenticated = true)] public OperationResult DoSomething(SomeParameters parmaters) { var operation = new DoSomethingOperation(_operationsManager, parmaters); return operation.RunSync(); }