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

1

5

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!

Edgebone answered 17/4, 2011 at 17:56 Comment(0)
I
7

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 :)

Incomprehension answered 17/4, 2011 at 18:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.