Embed Class


Represents an embedded object.

public class Embed : OEmbed, IValidatableObject, ICloneable
System.Object → OEmbedEmbed


Embed() Initializes a new instance of the Embed class.
Embed(OEmbed) Initializes a new instance of the Embed class with the given oEmbed data.


CreatedAt Gets the time (UTC) the embed url was fetched.
CreatedById Gets the id of the user that created the embed.
Description Gets or sets a description for the embed.
Host Gets the name of the host/domain where the embed originates.
Id Gets the embed id.
Image Gets the primary image for the embed (if any).
IsLink Gets or sets a UI hint telling the UI to render this embed as a link.
OriginalUrl Gets the original url the user provided.
Parent Gets a reference to the entity where the embed is embedded.


Clone() Creates a new object that is a copy of the current instance.
Validate(ValidationContext) Performs custom validation.

Extension Methods

IsNullOrDefault(T) Gets a value indicating if the specified value has the default value of the generic type.
Serialize(object) Serializes an object, or graph of connected objects, to a byte array.
SerializeToJson(object, Formatting?, JsonSerializerSettings) Serializes an object, or graph of connected objects, to a json string.
ThumbPlaceholderUrl(Embed, bool, bool) Returns a placeholder url to a thumbnail image of the specified Embed. The url contains the string "{options}" which can be replaced with the desired resize options, e.g. "128", "128x0", "0x128", "128x256" etc.
ThumbUrl(Embed, int?, int?, bool, FitMode, ScaleMode, ContentAlignment, Color?, int, int, bool, bool, bool, bool) Returns an url to a thumbnail image for the specified embed
IsValid(object) Determines whether the specified object is valid by evaluating each ValidationAttribute instance that is attached to the object type.