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 命名空间