DomainService method not compiling; claims "Return types must be an entity ..."
- by Duncan Bayne
I have a WCF RIA Domain Service that contains a method I'd like to invoke when the user clicks a button:
[Invoke]
public MyEntity PerformAnalysis(int someId)
{
return new MyEntity();
}
However, when I try to compile I'm given the following error:
Operation named 'PerformAnalysis' does not conform to the required signature. Return types must be an entity, collection of entities, or one of the predefined serializable types.
The thing is, as far as I can tell, MyEntity is an entity:
[Serializable]
public class MyEntity: EntityObject, IMyEntity
{
[Key]
[DataMember]
[Editable(false)]
public int DummyKey { get; set; }
[DataMember]
[Editable(false)]
public IEnumerable<SomeOtherEntity> Children { get; set; }
}
I figure I'm missing something simple here. Could someone please tell me how I can create an invokable method that returns a single MyEntity object?