We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eeae5a8 commit 9d35b40Copy full SHA for 9d35b40
dotnet/src/webdriver/BiDi/Network/BytesValue.cs
@@ -29,6 +29,16 @@ public abstract record BytesValue
29
{
30
public static implicit operator BytesValue(string value) => new StringBytesValue(value);
31
public static implicit operator BytesValue(byte[] value) => new Base64BytesValue(value);
32
+
33
+ public static explicit operator string(BytesValue value)
34
+ {
35
+ if (value is StringBytesValue stringBytesValue)
36
37
+ return stringBytesValue.Value;
38
+ }
39
40
+ throw new InvalidCastException($"Cannot cast '{value.GetType()}' to '{typeof(string)}'.");
41
42
}
43
44
public sealed record StringBytesValue(string Value) : BytesValue;
0 commit comments