Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Silverlight Error 263 Domain operation entry 'MyOperation' must take exactly one parameter

I have a Silverlight application that is using RIA Services. However, I need a service operation that takes multiple parameters. My operation looks like the following:

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

As it stands now, I get an error that says: Error 263 Domain operation entry 'MyOperation' must take exactly one parameter.

My question is, how do I create a service operation tht takes multiple parameters in a RIA Services service? Thanks!

like image 860
user687554 Avatar asked Apr 17 '11 17:04

user687554


1 Answers

The code that you provided works for me (as is). However, there will be an error if your operation's name isn't really MyOperation, but rather something like InsertOperation or AddOperation or something that falls into "CRUD" (Create Read Update Delete operations). That is caused some conventions in the RIA Services (which you can read about here).

To work around that, you can either use a name that doesn't fall into those conventions, or you can specify the operation to be an Invoke Operation by using the InvokeAttribute like so:

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

Hope this helps :)

like image 54
AbdouMoumen Avatar answered Sep 28 '22 07:09

AbdouMoumen