共用方式為


InsertAttribute 類別

指定 DomainService 方法是插入方法。

命名空間: System.ServiceModel.DomainServices.Server
組件: System.ServiceModel.DomainServices.Server (於 system.servicemodel.domainservices.server.dll)

使用方式

'用途
Dim instance As InsertAttribute

語法

'宣告
<AttributeUsageAttribute(AttributeTargets.Method Or AttributeTargets.Property Or AttributeTargets.Field, AllowMultiple:=False, Inherited:=True)> _
Public NotInheritable Class InsertAttribute
    Inherits Attribute
[AttributeUsageAttribute(AttributeTargets.Method|AttributeTargets.Property|AttributeTargets.Field, AllowMultiple=false, Inherited=true)] 
public sealed class InsertAttribute : Attribute
[AttributeUsageAttribute(AttributeTargets::Method|AttributeTargets::Property|AttributeTargets::Field, AllowMultiple=false, Inherited=true)] 
public ref class InsertAttribute sealed : public Attribute
/** @attribute AttributeUsageAttribute(AttributeTargets.Method|AttributeTargets.Property|AttributeTargets.Field, AllowMultiple=false, Inherited=true) */ 
public final class InsertAttribute extends Attribute
AttributeUsageAttribute(AttributeTargets.Method|AttributeTargets.Property|AttributeTargets.Field, AllowMultiple=false, Inherited=true) 
public final class InsertAttribute extends Attribute

備註

您將 InsertAttribute 屬性套用至方法,即可表示該方法是插入方法。如果您的方法符合插入方法預期的方法簽章,就不必套用 InsertAttribute。RIA Services 架構會推斷,具有預期之插入簽章的方法應該視為插入作業。您將 IgnoreAttribute 套用至方法,即可避免 RIA Services 架構針對該方法產生網域作業。

以下將示範插入方法的預期簽章:

傳回值

參數

實體

名稱前置詞

插入、加入或建立

屬性

[Insert] (C#)

-或-

<Insert()> (Visual Basic)

範例

public void InsertProduct(Product product) (C#)

-或-

Public Sub InsertProduct(ByVal product As Product) (Visual Basic)

繼承階層

System.Object
   System.Attribute
    System.ServiceModel.DomainServices.Server.InsertAttribute

執行緒安全性

任何這個類型的公用靜態 (在 Visual Basic 中為 共用) 成員都具備執行緒安全。 不保證任何執行個體成員安全執行緒。

平台

開發平台

Windows XP Home Edition, Windows XP Professional, Windows Server 2003 、Windows Server 2008 和 Windows 2000

目標平台

另請參閱

參考

InsertAttribute 成員
System.ServiceModel.DomainServices.Server 命名空間