Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

InsertAttribute Class

WCF RIA Services

[WCF RIA Services Version 1 Service Pack 2 is compatible with either .NET framework 4 or .NET Framework 4.5, and with either Silverlight 4 or Silverlight 5.]

Specifies that a DomainService method is an insert method.


Namespace:  System.ServiceModel.DomainServices.Server
Assembly:  System.ServiceModel.DomainServices.Server (in System.ServiceModel.DomainServices.Server.dll)

[AttributeUsageAttribute(AttributeTargets.Method|AttributeTargets.Property|AttributeTargets.Field, AllowMultiple = false, 
	Inherited = true)]
public sealed class InsertAttribute : Attribute

The InsertAttribute type exposes the following members.

Public methodInsertAttributeInitializes a new instance of the InsertAttribute class.

Public propertyTypeId (Inherited from Attribute.)

Public methodEquals (Inherited from Attribute.)
Protected methodFinalize (Inherited from Object.)
Public methodGetHashCode (Inherited from Attribute.)
Public methodGetType (Inherited from Object.)
Public methodIsDefaultAttribute (Inherited from Attribute.)
Public methodMatch (Inherited from Attribute.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodToString (Inherited from Object.)

Explicit interface implemetationPrivate method_Attribute.GetIDsOfNames (Inherited from Attribute.)
Explicit interface implemetationPrivate method_Attribute.GetTypeInfo (Inherited from Attribute.)
Explicit interface implemetationPrivate method_Attribute.GetTypeInfoCount (Inherited from Attribute.)
Explicit interface implemetationPrivate method_Attribute.Invoke (Inherited from Attribute.)

You apply the InsertAttribute attribute to a method to indicate that the method is an insert method. If your method matches the expected method signature for an insert method, you do not have to apply the InsertAttribute. The RIA Services framework will infer that a method with the expected insert signature should be treated as an insert operation. You apply the IgnoreAttribute to a method to prevent the RIA Services framework from generating a domain operation for that method.

The following shows the expected signature for an insert method:

Return value




Name Prefix

Insert, Add, or Create


[Insert] (C#)


<Insert()> (Visual Basic)


public void InsertProduct(Product product) (C#)


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

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
© 2015 Microsoft