从域服务获取字符串列表 [英] getting a string list from domain services

查看:107
本文介绍了从域服务获取字符串列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



任何人都可以解释如何在Silverlight页面(.cs页面)中使用普通服务(域服务),然后根据结果执行一些操作。以下是我在域名服务中使用的基本功能。



Hi,
Can anybody explain how to consume a normal service(domain service) in the Silverlight page(.cs page) and then perform some operations based on the result. Here is the basic functionality that I use in Domain Service.

public List<string> Hello()
{
    List<string> strList=new List<string>();
    strList.Add("Hello..");
    strList.Add("World..");
}



我已经使用过load,并试图直接访问(在页面中),但大多数时候我得到无法转换IEnumerableSting到清单字符串。



然后,一旦我从服务中得到结果,我必须调用其他功能。请注意,在域服务中,我没有function_Async和function_Completed属性(我不知道为什么)。



感谢您的帮助和时间。



问候,

Prasath SJ


I have used load, and tried to access directly (in the page) but most of the time I get "cannot convert IEnumerable"Sting" to List"String"".

Then once I got the result from the service I have to call other function. Please note that, In domain Service I couldn't have the function_Async and function_Completed properties (I don't know Why).

Thanks for your help and time.

Regards,
Prasath S J

推荐答案

嗨prasath,

使用下面的代码而不是你的代码并转换成Silverlight页面中的列表(.cs页面)和然后执行你的操作

代码:

public IQueryable< string>你好()

{

List< string> strList = new List< string>();

strList.Add(Hello ..);

strList.Add(World ..);

返回strList.AsQueryable();

}
Hi prasath,
use below code instead of ur code and converted into list in the Silverlight page(.cs page) and then perform ur operations
code:
public IQueryable<string> Hello()
{
List<string> strList=new List<string>();
strList.Add("Hello..");
strList.Add("World..");
return strList.AsQueryable();
}


这篇关于从域服务获取字符串列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆