Hi! There already exists a
module for embedding Silverlight content (created by me) - maybe you should try it instead of writing your own. Source is available on
Basically I had the same problem - wrote a Silverlight app as a GUI to interact with the underlying WCF service. As I had problems with getting WCF to work with the Autofac DI container (so to be able to inject some objects, eg. IOrchardServices and
so on, to the object handling a request) i sticked to the simple controller-based RESTful API via
MvcApi project. It works perfectly and totally serves my purposes. So for now, this is the best solution.
As far as I know the integration of WCF with Orchard and Autofac is possible, but involves upgrading the Autofac library to the recent version, which as I suppose the Team doesn't want to do right now (as lot of things has changed and it would totally
break the Orchard build).
Of course you can have an isolated WCF service inside Orchard (but without connection to the DI container), as inside any other ASP.NET app, and use from Silverlight embedded in a page.
About the MVC pattern... I know what you mean:) But... Silverlight is a standalone app, which requests data from your service and as such it should not be thought as a "View". View in this case would be eg. the JSON-formatted data Silverlight reads from