C# SDK - BatchFacade with Collections

Former Member
Former Member $organization

Greetings,

We've been working with the latest C# SDK and have begun working with the BatchFacade. We are liking the REST API and the SDK so far!

We've read some past TLCC presentations and a few other resources we were able to find on the network. We were able to find our way around some of our initial questions. We are stumped on one thing and are hoping somebody out there has done this (or knows it's not possible at the moment).

So we've been able to successfully use the BatchFacade to batch some basic calls. i.e. we can take a session key, get a session object, pass the constituent ID into constituent Info and get the Constituent back in one batch response. It makes sense and it works well.

Now we're interested in trying to feed a collection of attributes (ids, etc) into a batch request. We were wondering how to structure the DependsOnRequest and BatchRequest objects needed to do this. For example, say we are trying to get all of the performances within a season (75). We would get the Performance Seasons first as a collection and then feed those Ids somehow into the GetAll method for Performances. Does the BatchFacade allow this? If so then how would we change the code below? In theory this would work if the Production Seasons returned a single object instead of a collection.

While this isn't a practical application for us right now, we were asking the question over here since we may soon see the need to use the BatchFacade this way... if it's possible to do so. We understand that if this doesn't work in the way we're hoping then we can just break this into a few requests in our code. Any insight is appreciated. Thanks so much for your time. Below, it's implied that our tessituraService has been properly instantiated and credentialed.

 var dependsOnRequestValid = new List<DependsOnRequest> {
new DependsOnRequest() {
Id = 1,
IsUrlDependency = true,
SourcePath = "Id",
TargetPath = "ProductionSeasonIds",
},
};

BatchResponse batchResponse = await tessituraService.BatchFacade
.With(tessituraService.BatchFacade.Txn.ProductionSeasons.GetAll("75", "", "", null))
.With(tessituraService.BatchFacade.Txn.Performances.GetAll("", "", "", dependsOnRequestValid))
.Call();