< Dice‎ | RollData
Revision as of 22:24, 15 September 2017 by Skizzerz (talk | contribs) (Created page with "{{APIdoc|RollData.Metadata Property}} Gets or sets an optional metadata object that is passed as-is to the {{l|RollResult}} and is serialized alongside it. {{ns}} == Syntax...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

RollData.Metadata Property

From DiceRoller Documentation

Gets or sets an optional metadata object that is passed as-is to the RollResult and is serialized alongside it.

  • Namespace: Dice
  • Assembly: DiceRoller (in DiceRoller.dll)

Syntax

public object Metadata { get; set; }

Property Value

Type: System.Object

The metadata object

Remarks

The object should be able to roundtrip when serialized/deserialized. Implement ISerializable if needed. By default, Metadata is null. Metadata objects are not considered when determining if two RollResults are equal to each other.

It is anticipated that this would be used to store extra properties related to the roll which should be saved at a per-roll level rather than a per-post level. If saving at a per-post level, it would likely make more sense to implement those properties as additional fields in the database.