Im slowly delving into Silverlight and after a good attempt, finally, I can return my own custom object from my website to my silverlight client, use the WCF service with Siverlight support.
Now letโs break a little between the differences between the domain service and the WCF service.
Ive worked in tutorials where the domain service is tied to a data context and then tied to siliverlight controls. Excellent :) However, when I hit the rock, I tried to return something to the IQuerryable bar; like String, my own simple type, etc.
I found several tutorials, such as this , to mark a function with the [ServiceContract] annotation and have [Key] in your simple class. This did not work, [ServiceContract] could not be resolved, and later I found a guide saying that you are using [Invoke]. Then I got into problems when it was not possible to load the function and get the result, I basically go here
[Invoke] public string HelloWorld(string name) { return string.Format("Hello {0}.", name); } var helloWorld = new HelloWorldDomainContext();
Anyway, that's why I discovered WCF services with Silverlight support and can return my own custom objects and call it beautiful.
tl; dr - Are domain services only used to bind to Silverlight controls? Those. its kind of direct binding of one path and is called as and when necessary, and I do all sorting / filtering / selection related to Linq on the server?
And lets say that I want to return xmlString, then I use the WCF service? Can I use a combination of WCF and Domain Services in my application?
Sorry if the above is a bit confusing! Just trying to understand that all this comes from ASP.NET/Flex
Thanks.
Jammin
source share