Blob Class

Namespace:
Weavy.Core.Models
Assembly:
Weavy.Core.dll

A class containing metadata about a blob.

public class Blob : Expando, IExpando, IDynamicMetaObjectProvider, IEnumerable<KeyValuePair<string, object>>, IEnumerable, ICloneable
Inheritance:
System.Object → ExpandoBlob
Implements:
IExpando

Constructors

Blob() Initializes a new instance of the Blob class.

Properties

CreatedAt Gets or sets the time (UTC) the Blob was created.
CreatedById Gets the id of the user that created the Blob.
ETag Gets the ETag that uniquely identifies the blob.
Height Gets the height, in pixels, of the blob (only for images).
Id Gets the blob id.
MediaType Gets or sets the Media Type (https://www.iana.org/assignments/media-types/media-types.xhtml) of the file, e.g. "image/png".
Name Gets the file name of the blob.
ProviderGuid Gets or sets the id of the Blob provider, null to use the default provider.
Size Gets the size, in bytes, of the file.
Width Gets the width, in pixels, of the blob (only for images).

Methods

Clone() Create a deep copy of the current object.

Extension Methods

IsNullOrDefault(T) Gets a value indicating if the specified value has the default value of the generic type.
Ratio(Blob) Get the width/height ratio of an image.
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.
FileUrl(Blob, string, bool, bool) Returns the url to the binary data of a blob.
ThumbPlaceholderUrl(Blob, bool, bool) Returns a placeholder url to a thumbnail image of the specified blob. The url contains the string "{options}" which can be replaced with the desired resize options, e.g. "128", "128x0", "0x128", "128x256" etc.
ThumbUrl(Blob, int?, int?, bool, FitMode, ScaleMode, ContentAlignment, Color?, int, int, bool, bool, bool, bool) Returns an url to a thumbnail image for the specified blob.
IsValid(object) Determines whether the specified object is valid by evaluating each ValidationAttribute instance that is attached to the object type.