Cascade
Loading...
Searching...
No Matches
Buzzware.Cascade.FromBlobAttribute Class Reference

Attribute marking a property as the destination and type for conversion from a blob of a given path. The converter is also specified. More...

Inheritance diagram for Buzzware.Cascade.FromBlobAttribute:

Public Member Functions

 FromBlobAttribute (string pathProperty, Type? converter=null)
 FromBlobAttribute Constructor. Validates converter and initializes properties.
object? ConvertToPropertyType (byte[] blob, Type destinationPropertyType)
 Converts the provided blob data into the specified destination property type. Uses the provided converter if available, otherwise returns the original blob data.

Properties

string PathProperty [get]
 Name of a property holding the path to the blob.
IBlobConverterConverter [get]
 The converter to be used for converting the blob data.

Detailed Description

Attribute marking a property as the destination and type for conversion from a blob of a given path. The converter is also specified.

https://buzzware.github.io/cascade/api_reference/md_api__docs_2using__cascade_2associations_2associations.html

Constructor & Destructor Documentation

◆ FromBlobAttribute()

Buzzware.Cascade.FromBlobAttribute.FromBlobAttribute ( string pathProperty,
Type? converter = null )
inline

FromBlobAttribute Constructor. Validates converter and initializes properties.

Parameters
pathPropertyThe name of the property containing the path to the blob data.
converterThe type of the converter class that should implement IBlobConverter for converting blob data.

Member Function Documentation

◆ ConvertToPropertyType()

object? Buzzware.Cascade.FromBlobAttribute.ConvertToPropertyType ( byte[] blob,
Type destinationPropertyType )
inline

Converts the provided blob data into the specified destination property type. Uses the provided converter if available, otherwise returns the original blob data.

Parameters
blobThe byte array representing the data to be converted.
destinationPropertyTypeThe type to which the blob data should be converted.
Returns
The converted object to the destination property type or the original blob data if no converter is available.

The documentation for this class was generated from the following file:
  • Buzzware.Cascade/attributes/FromBlobAttribute.cs