我有一個WCF RIA域服務包含我想,當用戶點擊一個按鈕來調用一個方法:域服務方法不編譯;索賠「返回類型必須是實體......」
[Invoke]
public MyEntity PerformAnalysis(int someId)
{
return new MyEntity();
}
然而,當我嘗試編譯我提示以下錯誤:
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.
的事情是,據我所知,myEntity所是實體:
[Serializable]
public class MyEntity: EntityObject, IMyEntity
{
[Key]
[DataMember]
[Editable(false)]
public int DummyKey { get; set; }
[DataMember]
[Editable(false)]
public IEnumerable<SomeOtherEntity> Children { get; set; }
}
我想我在這裏錯過了一些簡單的東西。有人能告訴我如何創建一個返回單個MyEntity對象的可調用方法嗎?
鏈接不起作用。 – gius 2012-11-11 17:29:11
謝謝,我已將它們更新到web.archive.org鏈接。 – 2012-11-11 22:02:51