DataTypeAttribute コンストラクター

定義

DataTypeAttribute クラスの新しいインスタンスを初期化します。

オーバーロード

名前 説明
DataTypeAttribute(DataType)

指定した型名を使用して、 DataTypeAttribute クラスの新しいインスタンスを初期化します。

DataTypeAttribute(String)

指定したフィールド テンプレート名を使用して、 DataTypeAttribute クラスの新しいインスタンスを初期化します。

DataTypeAttribute(DataType)

ソース:
DataTypeAttribute.cs
ソース:
DataTypeAttribute.cs
ソース:
DataTypeAttribute.cs
ソース:
DataTypeAttribute.cs
ソース:
DataTypeAttribute.cs

指定した型名を使用して、 DataTypeAttribute クラスの新しいインスタンスを初期化します。

public:
 DataTypeAttribute(System::ComponentModel::DataAnnotations::DataType dataType);
public DataTypeAttribute(System.ComponentModel.DataAnnotations.DataType dataType);
new System.ComponentModel.DataAnnotations.DataTypeAttribute : System.ComponentModel.DataAnnotations.DataType -> System.ComponentModel.DataAnnotations.DataTypeAttribute
Public Sub New (dataType As DataType)

パラメーター

dataType
DataType

データ フィールドに関連付ける型の名前。

次の例は、 DataTypeAttribute(DataType) コンストラクターを使用して、データ フィールドの代替型を指定する方法を示しています。

// Add type information.
[DataType(DataType.EmailAddress)]
public object EmailAddress;
' Add type information.
<DataType(DataType.EmailAddress)> _
Public EmailAddress As Object

注釈

名前は、 System.ComponentModel.DataAnnotations.DataType 列挙体によって定義される値の 1 つです。

適用対象

DataTypeAttribute(String)

ソース:
DataTypeAttribute.cs
ソース:
DataTypeAttribute.cs
ソース:
DataTypeAttribute.cs
ソース:
DataTypeAttribute.cs
ソース:
DataTypeAttribute.cs

指定したフィールド テンプレート名を使用して、 DataTypeAttribute クラスの新しいインスタンスを初期化します。

public:
 DataTypeAttribute(System::String ^ customDataType);
public DataTypeAttribute(string customDataType);
new System.ComponentModel.DataAnnotations.DataTypeAttribute : string -> System.ComponentModel.DataAnnotations.DataTypeAttribute
Public Sub New (customDataType As String)

パラメーター

customDataType
String

データ フィールドに関連付けるユーザー設定フィールド テンプレートの名前。

例外

customDataTypenull または空の文字列 ("") です。

注釈

このメソッドは、 UIHintAttribute 属性を使用する代わりに使用できます。

適用対象