Silverlight Error 263 The record for the domain operation "MyOperation" must take exactly one parameter

I have a Silverlight application that uses RIA services. However, I need a maintenance operation that takes several parameters. My operation is as follows:

public void MyOperation(string userName, bool isActive, string emailAddress) { // Do Stuff } 

As of now, I get the error message: Error 263 The record of the operation in the "MyOperation" mode must take exactly one parameter.

My question is: how do I create a tht service operation that takes several parameters in RIA Services? Thanks!

+4
source share
1 answer

The code you provided works for me (as it is). However, there will be an error if your operation name is not really MyOperation , but rather something like InsertOperation or AddOperation or something that falls into "CRUD" (Create Read Update Delete). This caused some conventions in RIA services (which you can read here here ).

To get around this, you can use a name that does not apply to these conventions, or you can specify the operation as an Invoke operation using InvokeAttribute as follows:

 [Invoke] public void AddOperation(string userName, bool isActive, string emailAddress) { // Do Stuff } 

Hope this helps :)

+6
source

All Articles