SafeToPrepareAttribute 클래스

Marks the methods in the assembly that are safe to run with the ExecuteForPrepare property set to true.

상속 계층

System.Object
  System.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 Initializes a new instance of the SafeToPrepareAttribute class.

맨 위로 이동

속성

  이름 설명
공용 속성 IsSafeToPrepare Gets a value that indicates whether the associated method is safe to run with the ExecuteForPrepare property set to true.
공용 속성 TypeId (Attribute에서 상속됨)

맨 위로 이동

메서드

  이름 설명
공용 메서드 {dtor} Releases all resources used by the SafeToPrepareAttribute.
공용 메서드 Equals (Attribute에서 상속됨)
공용 메서드 GetHashCode (Attribute에서 상속됨)
공용 메서드 GetType (Object에서 상속됨)
공용 메서드 IsDefaultAttribute (Attribute에서 상속됨)
공용 메서드 Match (Attribute에서 상속됨)
공용 메서드 ToString (Object에서 상속됨)

맨 위로 이동

명시적 인터페이스 구현

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

맨 위로 이동

주의

If a user defined function (UDF) returns a DataTable, the UDF should be able to prepare for execution by running with the ExecuteForPrepare property set to true. To prepare for execution, the UDF should determine the structure of the DataTable needed to be returned, and return an empty DataTable that is structured appropriately.

In the following example, a simple UDF creates a DataTable. If the UDF runs with the ExecuteForPrepare property set to true, the UDF returns with an empty version of the DataTable. If the UDF runs with the ExecuteForPrepare property set to false, the UDF continues, populates the DataTable, and returns the populated 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 네임스페이스