DataObjectMethodAttribute Constructor (DataObjectMethodType, Boolean)
Initializes a new instance of the DataObjectMethodAttribute class, identifies the type of data operation the method performs, and identifies whether the method is the default data method that the data object exposes.
Assembly: System (in System.dll)
Parameters
- methodType
-
Type:
System.ComponentModel::DataObjectMethodType
One of the DataObjectMethodType values that describes the data operation the method performs.
- isDefault
-
Type:
System::Boolean
true to indicate the method that the attribute is applied to is the default method of the data object for the specified methodType; otherwise, false.
The following code example demonstrates how you can apply the DataObjectMethodAttribute attribute to a publicly exposed method and identify the type of data operation it performs as well as whether it is the type's default data method. In this example the NorthwindData type exposes two data methods: one to retrieve a set of data named GetAllEmployees, and another to delete data named DeleteEmployeeByID. The DataObjectMethodAttribute attribute is applied to both methods, the GetAllEmployees method is marked as the default method for the Select data operation, and the DeleteEmployeeByID method is marked as the default method for the Delete data operation.
Available since 2.0