private Location GetOrCreateLocation(string locationIdentifier) { return(!Client.TryGetLocationDescription(locationIdentifier, out var locationDescription) ? CreateLocation(locationIdentifier) : Client.Provisioning.Get(new GetLocation { LocationUniqueId = locationDescription.UniqueId })); }
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."); }