示例#1
0
        public override void Display()
        {
            base.Display();

            Console.WriteLine("We’ll create two new entities.");
            Console.WriteLine("The \"Destination\" simple entity will hold the flight destination.");
            Console.WriteLine("The \"Class\" hierarchical entity will accept \"First\", \"Business\" and \"Economy\" values.");

            var simpleEntity = new ModelCreateObject
            {
                Name = "Destination"
            };

            var simpleEntityId = AwaitTask(Client.Model.AddEntityAsync(AppId, VersionId, simpleEntity));

            Console.WriteLine($"{simpleEntity.Name} simple entity created with id {simpleEntityId}");

            var hierarchicalEntity = new HierarchicalEntityModel
            {
                Name     = "Class",
                Children = new[] { "First", "Business", "Economy" }
            };

            var hierarchicalEntityId = AwaitTask(Client.Model.AddHierarchicalEntityAsync(AppId, VersionId, hierarchicalEntity));

            Console.WriteLine($"{hierarchicalEntity.Name} hierarchical entity created with id {hierarchicalEntityId}");

            BaseProgram.sampleUtterance = "Find flights to London in first class";

            NavigateWithInitializer <FlightsEntityPage>((page) =>
            {
                page.AppId     = AppId;
                page.VersionId = VersionId;
            });
        }
示例#2
0
        public override void Display()
        {
            base.Display();

            Console.WriteLine("We’ll create a new \"Bouquet\" hierarchical entity.");
            Console.WriteLine("The Bouquet entity will contain \"Roses\" and \"Carnations\" as child entities.");

            var bouquetEntity = new HierarchicalEntityModel
            {
                Name     = "Bouquet",
                Children = new[] { "Roses", "Carnations" }
            };

            var entityId = AwaitTask(Client.Model.AddHierarchicalEntityAsync(AppId, VersionId, bouquetEntity));

            Console.WriteLine($"{bouquetEntity.Name} hierarchical Entity created with the id {entityId}");

            BaseProgram.sampleUtterance = "Send a bouquet of roses to Mary";

            NavigateWithInitializer <FlowerpotPage>((page) =>
            {
                page.AppId     = AppId;
                page.VersionId = VersionId;
            });
        }
示例#3
0
        public override void Display()
        {
            base.Display();

            Console.WriteLine("We’ll create a new \"Flowerpot\" hierarchical entity.");
            Console.WriteLine("The Flowerpot entity will contain \"Cactus\" as the only child entity.");

            var flowerpotEntity = new HierarchicalEntityModel
            {
                Name     = "Flowerpot",
                Children = new[] { "Cactus" }.ToList()
            };

            var entityId = AwaitTask(Client.Model.AddHierarchicalEntityAsync(this.AppId, this.VersionId, flowerpotEntity));

            Console.WriteLine($"{flowerpotEntity.Name} hierarchical Entity created with the id {entityId}");

            NavigateWithInitializer <AddFlowersPage>((page) => {
                page.AppId     = this.AppId;
                page.VersionId = this.VersionId;
                page.EntityId  = entityId;
            });
        }