Click here to Skip to main content
15,896,557 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
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.

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

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
Posted
Updated 27-Jun-13 0:40am
v2

1 solution

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();
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900