private async Task SetNewDeliveryAddressAsync(IDialogContext context, IAwaitable <DeliveryAddress> result) { var packageId = context.FindPackageId(); var newDeliveryAddress = await result; var packageManager = WebApiApplication.IoCResolver.GetInstance <IPackageManager>(); await packageManager.SetDeliveryAddressAsync(packageId, newDeliveryAddress); context.Wait(MessageReceived); }
public async Task StartAsync(IDialogContext context) { await Task.CompletedTask; _userName = context.FindUserName(); _packageId = context.FindPackageId(); if (!string.IsNullOrEmpty(_packageId)) { context.Call(new ConfirmPackageIdResuse(_packageId), AfterConfirmIdReuseAsync); } else { context.Call <string>(new AskForPackageId(), AfterAskingForPackageIdAsync); } }