Exemplo n.º 1
0
    public void ExportAysnc(int id)
    {
        AsyncManager.OutstandingOperations.Increment();
        // that's the web service client proxy that should
        // contain the async versions of the methods
        var someService = new SomeService();

        someService.ExportTo3rdPartyCompleted += (sender, e) =>
        {
            AsyncManager.Parameters["result"] = e.Value;
            AsyncManager.OutstandingOperations.Decrement();
        };
        var invoice = _salesService.GetById(id);

        someService.ExportTo3rdPartyAsync(invoice);
    }
Exemplo n.º 2
0
    public void ExportAysnc(int id)
    {
        AsyncManager.OutstandingOperations.Increment();
        // that's the web service client proxy that should
        // contain the async versions of the methods
        var someService = new SomeService();

        someService.ExportTo3rdPartyCompleted += (sender, e) =>
        {
            // TODO: Make sure you handle exceptions here
            // and ensure that you always call the AsyncManager.OutstandingOperations.Decrement()
            // method at the end
            AsyncManager.Parameters["result"] = e.Value;
            AsyncManager.OutstandingOperations.Decrement();
        };
        var invoice = _salesService.GetById(id);

        someService.ExportTo3rdPartyAsync(invoice);
    }