Class ApiMedia
Represents media in the Delivery API.
Inheritance
object
Namespace: Umbraco.Cms.Core.Models.DeliveryApi
Assembly: Umbraco.Core.dll
Syntax
public sealed class ApiMedia : IApiMedia
Constructors
View SourceApiMedia(Guid, string, string, string, string?, int?, int?, int?, IDictionary<string, object?>)
Initializes a new instance of the ApiMedia class.
Declaration
public ApiMedia(Guid id, string name, string mediaType, string url, string? extension, int? width, int? height, int? bytes, IDictionary<string, object?> properties)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | id | The unique identifier of the media. |
| string | name | The name of the media. |
| string | mediaType | The media type alias. |
| string | url | The URL of the media. |
| string | extension | The file extension of the media. |
| int? | width | The width of the media in pixels. |
| int? | height | The height of the media in pixels. |
| int? | bytes | The size of the media in bytes. |
| IDictionary<string, object> | properties | The property values of the media. |
Properties
View SourceBytes
Gets the size of the media in bytes.
Declaration
public int? Bytes { get; }
Property Value
| Type | Description |
|---|---|
| int? |
Extension
Gets the file extension of the media.
Declaration
public string? Extension { get; }
Property Value
| Type | Description |
|---|---|
| string |
Height
Gets the height of the media in pixels, if applicable.
Declaration
public int? Height { get; }
Property Value
| Type | Description |
|---|---|
| int? |
Id
Gets the unique identifier of the media.
Declaration
public Guid Id { get; }
Property Value
| Type | Description |
|---|---|
| Guid |
MediaType
Gets the media type alias.
Declaration
public string MediaType { get; }
Property Value
| Type | Description |
|---|---|
| string |
Name
Gets the name of the media.
Declaration
public string Name { get; }
Property Value
| Type | Description |
|---|---|
| string |
Properties
Gets the property values of the media.
Declaration
public IDictionary<string, object?> Properties { get; }
Property Value
| Type | Description |
|---|---|
| IDictionary<string, object> |
Url
Gets the URL of the media.
Declaration
public string Url { get; }
Property Value
| Type | Description |
|---|---|
| string |
Width
Gets the width of the media in pixels, if applicable.
Declaration
public int? Width { get; }
Property Value
| Type | Description |
|---|---|
| int? |