public static T ReadRequired <T>(this TwinCollection twinCollection, string property, ILogger?logger = null) => twinCollection.TryRead(property, logger, out T? result) ? result : throw new InvalidOperationException($"Property '{property}' does not exist or is invalid.");
public static T?SafeRead <T>(this TwinCollection twinCollection, string property, T?defaultValue = default, ILogger?logger = null) => twinCollection.TryRead <T>(property, logger, out var someT) ? someT : defaultValue;