Skip to content

Commit 7aa32ab

Browse files
committed
feat!: drop As<T> and alias ActualInstance as Value on union types
1 parent fb41e3a commit 7aa32ab

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

‎wrapper/VRChat.API/Model/GeneratedModelExtensions.cs‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,21 @@ public partial class TwoFactorEmailCode : ITwoFactorCode { }
1818
public abstract partial class AbstractOpenAPISchema
1919
{
2020
/// <summary>
21-
/// Whether this instance holds a <typeparamref name="T"/>.
21+
/// The value this instance holds: one of the union's member types.
2222
/// </summary>
23-
public bool Is<T>() => ActualInstance is T;
23+
public object Value => ActualInstance;
2424

2525
/// <summary>
26-
/// The <typeparamref name="T"/> this instance holds, throwing <see cref="System.InvalidCastException"/> when it holds another type.
26+
/// Whether this instance holds a <typeparamref name="T"/>.
2727
/// </summary>
28-
public T As<T>() => (T)ActualInstance;
28+
public bool Is<T>() => Value is T;
2929

3030
/// <summary>
3131
/// Gets the <typeparamref name="T"/> this instance holds, if it holds one.
3232
/// </summary>
3333
public bool TryGet<T>(out T value)
3434
{
35-
if (ActualInstance is T instance)
35+
if (Value is T instance)
3636
{
3737
value = instance;
3838
return true;

0 commit comments

Comments
 (0)