Class QuestionActivityEntity
- Namespace
- ActivityPub.Types.AS.Extended.Activity
- Assembly
- ActivityPub.Types.dll
Represents a question being asked. Question objects are an extension of IntransitiveActivity. That is, the Question object is an Activity, but the direct object is the question itself and therefore it would not contain an object property. Either of the anyOf and oneOf properties MAY be used to express possible answers, but a Question object MUST NOT have both properties.
public sealed class QuestionActivityEntity : ASEntity<QuestionActivity, QuestionActivityEntity>, IJsonOnDeserialized, IJsonOnSerializing
- Inheritance
-
QuestionActivityEntity
- Implements
- Inherited Members
Properties
AllowMultiple
Indicates whether this question accepts multiple responses. If true, then multiple options can be selected. If false (default), then only one option may be selected.
[JsonIgnore]
public bool AllowMultiple { get; set; }
Property Value
Remarks
This is a synthetic field implemented to simplify parts of the Question schema. It does not exist in the ActivityStreams specification.
This field controls how the question is serialized. If true, then Options will map to "anyOf". Otherwise, it maps to "oneOf".
AnyOf
[JsonPropertyName("anyOf")]
[JsonInclude]
private LinkableList<ASObject>? AnyOf { get; set; }
Property Value
Closed
Indicates that a question has been closed, and answers are no longer accepted.
[JsonPropertyName("closed")]
public FlagWithTimestamp? Closed { get; set; }
Property Value
Remarks
We don't support the Object or Link forms, because what would that even mean??
- See Also
OneOf
[JsonPropertyName("oneOf")]
[JsonInclude]
private LinkableList<ASObject>? OneOf { get; set; }
Property Value
Options
The list of options for this Question.
[JsonIgnore]
public LinkableList<ASObject>? Options { get; set; }
Property Value
Remarks
This is a semi-synthetic property. It does not exist in the ActivityStreams specification, but encapsulates the usage of both "oneOf" and "anyOf".
- See Also
Explicit Interface Implementations
IJsonOnDeserialized.OnDeserialized()
The method that is called after deserialization.
void IJsonOnDeserialized.OnDeserialized()
IJsonOnSerializing.OnSerializing()
The method that is called before serialization.
void IJsonOnSerializing.OnSerializing()