English 中文(简体)
RIA 服务需要公证、非专用方法汇编
原标题:RIA service needs dummy public, non-attributed methods to compile

我正在执行一项银星应用,在服务器方面提供全球功能评估服务,我正在经历非常奇怪的行为。

目前,这项服务非常简单,只有几种方法,所有方法都标有<条码>[Invoke]属性。 这些方法类似:

[Invoke]
MyEntity DoWorkAndReturnEntity(string someParameter)
{
    var entity = new MyEntity();
    //Do some preocessing...
    return entity;
}

<代码>MyEntity的类型有1个公共财产,有[Key] 属:

public class MyEntity
{
    [Key]
    public int Key {get;set;}
}

如果我试图汇编解决办法,我有以下错误:

Operation named DoWorkAndReturnEntity does not conform to the required signature. Return types must be an entity, collection of entities, or one of the predefined serializable types.

现在是难得的。 如果加上一种公开的圆形方法,使一个同类实体返回,但noInvoke属性,那么它就编纂并完美地开展工作!

public MyEntity __Dummy()
{
    return null;
}

不管归还的物体类型如何,所有方法都是如此。 因此,我必须加上每一回归物体类型的 du。

我完全感到迷惑。 这里的情况如何?

最佳回答

实体类型由域名中的一套查询方法界定。

援引方法不能归还实体类型,除非是由域名部门返还的实体之一......因此,...... Dummy query方法使事情发挥作用。

问题回答

WCF RIA 各项服务使用组合式设计,DoWorkAndReturnEntity 这种方法需要与<代码>[质量]属性或无属性”加以校正,因为<代码>[质量]<代码>是缺省,就像在<_Dummy上。





相关问题
Silverlight Rich text box control

Our team decided that we need our own custom Rich text box control for Silverlight app we are developing. We looked at existing controls mentioned at A good rich text control for Silverlight but ...

Silverlight ImageBrush not rendering (with Bing Map Control)

I m trying to add an image to a Pushpin instance from the Silverlight Bing Map Control, but I can t seem to get it to render (the pushpin renders fine). This is probably a general WPF question rather ...

Silverlight OpenFileDialog DoEvents equivalent

I m processing large files after they are selected by the user. My code looks like the following: if (FileDialog.ShowDialog() == true) { // process really big file } This freezes up the UI so ...

list of controls with templates in silverlight

Does anyone know where to find a list of controls that you can set the template on in Silverlight? I ve wasted several hours now trying to create control templates only to find that the control doesn ...

Silverlight, Updating the UI during processing

I have a simple silverlight multifile upload application, and i want to provide the user with some feedback, right now its only in a test phase and i dont have the webservice. Somehow i cant get the ...

Silverlight 3 - FindName returns null

This looks a bug to me.. Using Silverlight 3 and i have a user control defined in XAML and trying to access the object during runtime returns a null. <Grid> <common:CommonGridEditPanel x:...

silverlight 3 collection binding

Someone please help me understand why this binding does not work... I have a class called SelectionManager with a property called dates which is populated by a WCF service. The property is an ...

热门标签