public override void Display() { base.Display(); var addNew = Input.ReadString("Do you want to add more flowers to the \"Flowerpot\" entity? (y/n)"); while (addNew.Trim().ToLowerInvariant().StartsWith("y")) { var childEntity = new HierarchicalChildModelCreateObject { Name = Input.ReadString("Type the flower name (e.g. \"Ficus\"): ") }; var result = AwaitTask(Client.Model.AddHierarchicalEntityChildAsync(this.AppId, this.VersionId, this.EntityId, childEntity)); Console.WriteLine($"Child Entity \"{childEntity.Name}\" added to the Parent Entity {this.EntityId}\n"); addNew = Input.ReadString("Do you want to add more flowers to the \"Flowerpot\" entity? (y/n)"); } NavigateWithInitializer <SendFlowersIntentPage>((page) => { page.AppId = AppId; page.VersionId = VersionId; }); }
public void AddHierarchicalEntityChild() { UseClientFor(async client => { var entityId = await client.Model.AddHierarchicalEntityAsync(GlobalAppId, GlobalVersionId, new HierarchicalEntityModel(new List <string>() { "ChildTest" }, name: "HierarchicalTest")); var childEntity = new HierarchicalChildModelCreateObject { Name = "NewChildEntity" }; var result = await client.Model.AddHierarchicalEntityChildAsync(GlobalAppId, GlobalVersionId, entityId, childEntity); await client.Model.DeleteHierarchicalEntityAsync(GlobalAppId, GlobalVersionId, entityId); Assert.True(result != Guid.Empty); }); }