SafeToPrepareAttribute 클래스

어셈블리에서 ExecuteForPrepare 속성을 true로 설정하여 안전하게 실행할 수 있는 메서드를 표시합니다.

상속 계층

Object
  Attribute
    Microsoft.AnalysisServices.AdomdServer.SafeToPrepareAttribute

네임스페이스:  Microsoft.AnalysisServices.AdomdServer
어셈블리:  msmgdsrv(msmgdsrv.dll)

구문

‘선언
Public NotInheritable Class SafeToPrepareAttribute _
    Inherits Attribute
‘사용 방법
Dim instance As SafeToPrepareAttribute
public sealed class SafeToPrepareAttribute : Attribute
public ref class SafeToPrepareAttribute sealed : public Attribute
[<SealedAttribute>]
type SafeToPrepareAttribute =  
    class 
        inherit Attribute 
    end
public final class SafeToPrepareAttribute extends Attribute

SafeToPrepareAttribute 유형에서 다음 멤버를 표시합니다.

생성자

  이름 설명
공용 메서드 SafeToPrepareAttribute SafeToPrepareAttribute 클래스의 새 인스턴스를 초기화합니다.

위쪽

속성

  이름 설명
공용 속성 IsSafeToPrepare 연결된 메서드가 ExecuteForPrepare 속성을 true로 설정하여 안전하게 실행할 수 있는지 여부를 나타내는 값을 가져옵니다.
공용 속성 TypeId (Attribute에서 상속됨)

위쪽

메서드

  이름 설명
공용 메서드 {dtor} SafeToPrepareAttribute 에서 사용하는 모든 리소스를 해제합니다.
공용 메서드 Equals (Attribute에서 상속됨)
공용 메서드 GetHashCode (Attribute에서 상속됨)
공용 메서드 GetType (Object에서 상속됨)
공용 메서드 IsDefaultAttribute (Attribute에서 상속됨)
공용 메서드 Match (Attribute에서 상속됨)
공용 메서드 ToString (Object에서 상속됨)

위쪽

명시적 인터페이스 구현

  이름 설명
명시적 인터페이스 구현전용 메서드 System#Runtime#InteropServices#_Attribute#GetIDsOfNames (Attribute에서 상속됨)
명시적 인터페이스 구현전용 메서드 System#Runtime#InteropServices#_Attribute#GetTypeInfo (Attribute에서 상속됨)
명시적 인터페이스 구현전용 메서드 System#Runtime#InteropServices#_Attribute#GetTypeInfoCount (Attribute에서 상속됨)
명시적 인터페이스 구현전용 메서드 System#Runtime#InteropServices#_Attribute#Invoke (Attribute에서 상속됨)

위쪽

주의

UDF(사용자 정의 함수)가 DataTable을 반환할 경우, UDF는 true로 설정된 ExecuteForPrepare 속성으로 실행해서 작업 수행을 준비할 수 있어야 합니다 수행을 준비하기 위해 UDF는 반환해야 하는 DataTable의 구조를 확인하고 올바르게 구조화된 빈 DataTable을 반환해야 합니다.

다음 예제에서는 간단한 UDF를 통해 DataTable을 만듭니다. true로 설정된 ExecuteForPrepare 속성으로 UDF를 실행할 경우, UDF는 비어 있는 DataTable을 반환합니다. false로 설정된 ExecuteForPrepare 속성으로 UDF를 실행할 경우 UDF는 작업을 계속해서, DataTable을 채우고, 채워진 DataTable을 반환합니다.

[SafeToPrepare(true)]
public System.Data.DataTable GetPreparedTable()
{
    System.Data.DataTable results = new System.Data.DataTable();
    results.Columns.Add("A", typeof(int));
    results.Columns.Add("B", typeof(string));

    if (Context.ExecuteForPrepare)
    {
        // If preparing, return just the schema with no data
        return results;
    }

    //Otherwise return data
    object[] row = new object[2];
    row[0] = 1;
    row[1] = "A";
    results.Rows.Add(row);

    row[0] = 2;
    row[1] = "B";
    results.Rows.Add(row);

    return results;
}

스레드 보안

이 유형의 모든 공용 static(Visual Basic에서는 Shared) 멤버는 스레드로부터 안전합니다. 인스턴스 멤버는 스레드로부터의 안전성이 보장되지 않습니다.

참고 항목

참조

Microsoft.AnalysisServices.AdomdServer 네임스페이스