C# Class Felinesoft.UmbracoCodeFirst.Attributes.DataTypeAttribute

Inheritance: CodeFirstAttribute, IInitialisableAttribute
Mostrar archivo Open project: DanMannMann/UmbracoCodeFirst

Public Methods

Method Description
DataTypeAttribute ( string propertyEditorAlias = null, string name = null, Type converterType = null, DatabaseType dbType = DatabaseType.None, bool useConverter = true ) : System

Specifies that the decorated type is a code-first data type

Initialise ( Type targetType ) : void

Initialises the Factory property based on the type to which the attribute is applied.

Protected Methods

Method Description
GetConverterType ( ) : Type

Gets the converter type

MakeAutoConverterType ( Type targetType, DatabaseType &storageType ) : Type

Composes a generic converter which can convert the IUmbracoDataType to which this attribute is applied

Method Details

DataTypeAttribute() public method

Specifies that the decorated type is a code-first data type
public DataTypeAttribute ( string propertyEditorAlias = null, string name = null, Type converterType = null, DatabaseType dbType = DatabaseType.None, bool useConverter = true ) : System
propertyEditorAlias string The property editor alias for the data type
name string The instance name for the data type
converterType System.Type The default converter type which can convert between the code-first class and an Umbraco property of that data type
dbType DatabaseType The storage type used to store the data type value in the database
useConverter bool False to use no converter if converterType is null, true to attempt to use an automatic converter. /// Using an automatic converter requires the data type class to implement IUmbracoDataType[`Tdb]
return System

GetConverterType() protected method

Gets the converter type
protected GetConverterType ( ) : Type
return Type

Initialise() public method

Initialises the Factory property based on the type to which the attribute is applied.
public Initialise ( Type targetType ) : void
targetType Type The type to which the attribute is applied
return void

MakeAutoConverterType() protected method

Composes a generic converter which can convert the IUmbracoDataType to which this attribute is applied
protected MakeAutoConverterType ( Type targetType, DatabaseType &storageType ) : Type
targetType Type
storageType DatabaseType
return Type