DataObjectFieldAttribute 생성자

정의

DataObjectFieldAttribute 클래스의 새 인스턴스를 초기화합니다.

오버로드

DataObjectFieldAttribute(Boolean)

DataObjectFieldAttribute 클래스의 새 인스턴스를 초기화하고 필드가 데이터 행의 기본 키인지 여부를 나타냅니다.

DataObjectFieldAttribute(Boolean, Boolean)

DataObjectFieldAttribute 클래스의 새 인스턴스를 초기화하고 필드가 데이터 행의 기본 키인지 여부와 필드가 데이터베이스 ID 필드인지 여부를 나타냅니다.

DataObjectFieldAttribute(Boolean, Boolean, Boolean)

DataObjectFieldAttribute 클래스의 새 인스턴스를 초기화하고 필드가 데이터 행의 기본 키인지 여부, 필드가 데이터베이스 ID 필드인지 여부 및 필드가 null일 수 있는지 여부를 나타냅니다.

DataObjectFieldAttribute(Boolean, Boolean, Boolean, Int32)

DataObjectFieldAttribute 클래스의 새 인스턴스를 초기화하며, 필드가 데이터 행의 기본 키인지 여부, 필드가 데이터베이스 ID 필드인지 여부 및 필드가 null일 수 있는지 여부를 나타내고 필드의 길이를 설정합니다.

DataObjectFieldAttribute(Boolean)

Source:
DataObjectFieldAttribute.cs
Source:
DataObjectFieldAttribute.cs
Source:
DataObjectFieldAttribute.cs

DataObjectFieldAttribute 클래스의 새 인스턴스를 초기화하고 필드가 데이터 행의 기본 키인지 여부를 나타냅니다.

public:
 DataObjectFieldAttribute(bool primaryKey);
public DataObjectFieldAttribute (bool primaryKey);
new System.ComponentModel.DataObjectFieldAttribute : bool -> System.ComponentModel.DataObjectFieldAttribute
Public Sub New (primaryKey As Boolean)

매개 변수

primaryKey
Boolean

필드가 데이터 행의 기본 키에 있음을 나타내려면 true이고, 그렇지 않으면 false입니다.

적용 대상

DataObjectFieldAttribute(Boolean, Boolean)

Source:
DataObjectFieldAttribute.cs
Source:
DataObjectFieldAttribute.cs
Source:
DataObjectFieldAttribute.cs

DataObjectFieldAttribute 클래스의 새 인스턴스를 초기화하고 필드가 데이터 행의 기본 키인지 여부와 필드가 데이터베이스 ID 필드인지 여부를 나타냅니다.

public:
 DataObjectFieldAttribute(bool primaryKey, bool isIdentity);
public DataObjectFieldAttribute (bool primaryKey, bool isIdentity);
new System.ComponentModel.DataObjectFieldAttribute : bool * bool -> System.ComponentModel.DataObjectFieldAttribute
Public Sub New (primaryKey As Boolean, isIdentity As Boolean)

매개 변수

primaryKey
Boolean

필드가 데이터 행의 기본 키에 있음을 나타내려면 true이고, 그렇지 않으면 false입니다.

isIdentity
Boolean

필드가 데이터 행을 고유하게 식별하는 ID 필드임을 나타내려면 true이고, 그렇지 않으면 false입니다.

적용 대상

DataObjectFieldAttribute(Boolean, Boolean, Boolean)

Source:
DataObjectFieldAttribute.cs
Source:
DataObjectFieldAttribute.cs
Source:
DataObjectFieldAttribute.cs

DataObjectFieldAttribute 클래스의 새 인스턴스를 초기화하고 필드가 데이터 행의 기본 키인지 여부, 필드가 데이터베이스 ID 필드인지 여부 및 필드가 null일 수 있는지 여부를 나타냅니다.

public:
 DataObjectFieldAttribute(bool primaryKey, bool isIdentity, bool isNullable);
public DataObjectFieldAttribute (bool primaryKey, bool isIdentity, bool isNullable);
new System.ComponentModel.DataObjectFieldAttribute : bool * bool * bool -> System.ComponentModel.DataObjectFieldAttribute
Public Sub New (primaryKey As Boolean, isIdentity As Boolean, isNullable As Boolean)

매개 변수

primaryKey
Boolean

필드가 데이터 행의 기본 키에 있음을 나타내려면 true이고, 그렇지 않으면 false입니다.

isIdentity
Boolean

필드가 데이터 행을 고유하게 식별하는 ID 필드임을 나타내려면 true이고, 그렇지 않으면 false입니다.

isNullable
Boolean

필드가 데이터 저장소에서 null일 수 있음을 나타내려면 true이고, 그렇지 않으면 false입니다.

예제

다음 코드 예제를 적용 하는 방법을 보여 줍니다.는 DataObjectFieldAttribute 공개적으로 노출 된 속성에 연결 된 메타 데이터를 식별 하는 속성입니다. 이 예제에서 형식은 NorthwindEmployee , FirstNameLastName의 세 가지 EmployeeID데이터 속성을 노출합니다. 특성은 DataObjectFieldAttribute 세 가지 속성 모두에 적용되지만 속성 특성만 EmployeeID 데이터 행의 기본 키임을 나타냅니다.

public class NorthwindEmployee
{
  public NorthwindEmployee() { }

  private int _employeeID;
  [DataObjectFieldAttribute(true, true, false)]
  public int EmployeeID
  {
    get { return _employeeID; }
    set { _employeeID = value; }
  }

  private string _firstName = String.Empty;
  [DataObjectFieldAttribute(false, false, true)]
  public string FirstName
  {
    get { return _firstName; }
    set { _firstName = value; }
  }

  private string _lastName = String.Empty;
  [DataObjectFieldAttribute(false, false, true)]
  public string LastName
  {
    get { return _lastName; }
    set { _lastName = value; }
  }
}
Public Class NorthwindEmployee

  Public Sub New()
  End Sub

  Private _employeeID As Integer
  <DataObjectFieldAttribute(True, True, False)> _
  Public Property EmployeeID() As Integer
    Get
      Return _employeeID
    End Get
    Set(ByVal value As Integer)
      _employeeID = value
    End Set
  End Property

  Private _firstName As String = String.Empty
  <DataObjectFieldAttribute(False, False, False)> _
  Public Property FirstName() As String
    Get
      Return _firstName
    End Get
    Set(ByVal value As String)
      _firstName = value
    End Set
  End Property

  Private _lastName As String = String.Empty
  <DataObjectFieldAttribute(False, False, False)> _
  Public Property LastName() As String
    Get
      Return _lastName
    End Get
    Set(ByVal value As String)
      _lastName = value
    End Set
  End Property

End Class

적용 대상

DataObjectFieldAttribute(Boolean, Boolean, Boolean, Int32)

Source:
DataObjectFieldAttribute.cs
Source:
DataObjectFieldAttribute.cs
Source:
DataObjectFieldAttribute.cs

DataObjectFieldAttribute 클래스의 새 인스턴스를 초기화하며, 필드가 데이터 행의 기본 키인지 여부, 필드가 데이터베이스 ID 필드인지 여부 및 필드가 null일 수 있는지 여부를 나타내고 필드의 길이를 설정합니다.

public:
 DataObjectFieldAttribute(bool primaryKey, bool isIdentity, bool isNullable, int length);
public DataObjectFieldAttribute (bool primaryKey, bool isIdentity, bool isNullable, int length);
new System.ComponentModel.DataObjectFieldAttribute : bool * bool * bool * int -> System.ComponentModel.DataObjectFieldAttribute
Public Sub New (primaryKey As Boolean, isIdentity As Boolean, isNullable As Boolean, length As Integer)

매개 변수

primaryKey
Boolean

필드가 데이터 행의 기본 키에 있음을 나타내려면 true이고, 그렇지 않으면 false입니다.

isIdentity
Boolean

필드가 데이터 행을 고유하게 식별하는 ID 필드임을 나타내려면 true이고, 그렇지 않으면 false입니다.

isNullable
Boolean

필드가 데이터 저장소에서 null일 수 있음을 나타내려면 true이고, 그렇지 않으면 false입니다.

length
Int32

필드의 길이(바이트)입니다.

적용 대상