The XPO persistent class used to store media data in the database.
[MediaDataObject("MediaDataKey", "MediaData", "MediaData")] [Browsable(false)] [EditorAlias("ImagePropertyEditor")] public class MediaDataObject : BaseObject
<MediaDataObject("MediaDataKey", "MediaData", "MediaData")> <Browsable(False)> <EditorAlias("ImagePropertyEditor")> Public Class MediaDataObject Inherits BaseObject
You can use the MediaDataObject type to declare a reference property of a business class that will be used to store and display an image.
Both WinForms and ASP.NET Image Property Editors are used automatically for properties of the MediaDataObject type.
An example is provided in the Image as a MediaDataObject section of the BLOB Image Properties in XPO topic.
MediaDataObject is a container for two values:
A byte array object that is loaded from a database on demand when required. It is not loaded together with the MediaDataObject itself and may contain any type of media.
A key value of the string type. This value should not be changed from your code. It is updated automatically when the MediaData byte array is changed and is unique for each MediaDataObject. MediaDataKey is used in a URL of the MediaData loaded by a browser. The URL is generated under the following conditions.
Currently, the MediaDataObject property type is completely supported by ASPxImagePropertyEditor only. The ImagePropertyEditor supports it partially - it uses MediaData only, and does not provide caching.
It is not recommend to change the MediaData value by direct database queries. In this instance, the URL will not change, and it will be required to manually refresh the page to see the changes.