A newer version of this page is available. Switch to the current version.

StreamAttribute Class

Applied to fields or a properties of an XPO persistent class. Specifies that the target string or byte[] property/field is a stream, when generating OData Service metadata.

Namespace: DevExpress.Xpo

Assembly: DevExpress.Xpo.v18.2.Extensions.dll


[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, Inherited = true, AllowMultiple = false)]
public class StreamAttribute :
<AttributeUsage(AttributeTargets.Property Or AttributeTargets.Field, Inherited:=True, AllowMultiple:=False)>
Public Class StreamAttribute
    Inherits Attribute


The StreamAttribute allows you to specify the stream name and content type, using the name and contentType parameters.

If you do not want to modify the target class source, you can override the SetStreamContentType and SetNamedStreamData methods in the XpoContext descendant. Note that the StreamAttributeattribute has a higher priority than overridden XpoContext methods.

By default, only the byte[] properties are considered as streams. Their default content type is "application/streamingmedia". You can change this behavior by overriding the XpoContext.ShowLargePropertyAsNamedStream method.


See Also