soren.enemaerke
soren.enemaerke

Reputation: 4830

Invoke method on WCF RIA Services

I can't make this seemingly simple call on my DomainService compile. I keep getting 'Operation named 'ComposeNewOrder' does not conform to the required signature. Parameter types must be an entity type or one of the predefined serializable types.'

Am I missing something here, should I be doing it in another way or is it just unsupported? (I'm using WCF RIA services 1.0 for VS2010)

public class ComposedOrder
{
    [Key]
    public Order Order { get; set; }
    public OrderPart[] Parts { get; set; }
}
public class MyDomainService{
    ...
    [Invoke]
    public void ComposeNewOrder(ComposedOrder co)
    {
      //implementation
    }
    ...
}

I have CRUD operations defined for Order and OrderPart which are entities from my EntityFramework model.

Upvotes: 0

Views: 1179

Answers (2)

Zorayr
Zorayr

Reputation: 24902

I have actually written an invoke method passing it a entity argument and it works.

Upvotes: 0

robertkroll
robertkroll

Reputation: 8784

Invoke operations cannot take Entity types (such as your ComposedOrder) as parameters. You can only use data types, such as int, string etc. You could pass in the key of your ComposedOrder and load it using that.

Upvotes: 1

Related Questions