コード例 #1
0
 private Location GetOrCreateLocation(string locationIdentifier)
 {
     return(!Client.TryGetLocationDescription(locationIdentifier, out var locationDescription)
         ? CreateLocation(locationIdentifier)
         : Client.Provisioning.Get(new GetLocation {
         LocationUniqueId = locationDescription.UniqueId
     }));
 }
コード例 #2
0
        public static LocationDescription FindLocationDescription(this IAquariusClient client, string locationIdentifier)
        {
            if (client.TryGetLocationDescription(locationIdentifier, out var locationDescription))
            {
                return(locationDescription);
            }

            throw new ExpectedException($"Location '{locationIdentifier}' does not exist in the system.");
        }