Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
            }
        }