Table of Contents

Class UnionCaseContract

Namespace
ShapeShift.Schema
Assembly
ShapeShift.dll

Describes one case of a UnionContract.

public sealed class UnionCaseContract
Inheritance
UnionCaseContract
Inherited Members

Constructors

UnionCaseContract(string, int, DataContract)

Describes one case of a UnionContract.

public UnionCaseContract(string name, int tag, DataContract type)

Parameters

name string

The name of the union case.

tag int

The integer tag assigned to the union case.

type DataContract

The contract for the value carried by this case.

Properties

IsTagSpecified

Gets a value indicating whether Tag was explicitly assigned and is therefore used as the discriminator when writing.

public bool IsTagSpecified { get; init; }

Property Value

bool

Remarks

When false, Name is written as the discriminator instead. Deserialization accepts either form.

Name

Gets the name of the union case.

public string Name { get; }

Property Value

string

Tag

Gets the integer tag assigned to the union case.

public int Tag { get; }

Property Value

int

Type

Gets the contract for the value carried by this case.

public DataContract Type { get; }

Property Value

DataContract

Methods

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.