I want to use Entity framework in silverlight , But with out RIA service .
Is there any way ?
If WCF RIA is mandatory than why so ?
Silverlight is a client side runtime (Code is not executed on the server). And therefore you cannot use Entity Framework to call a DB directly from it. RIA Services essentially create a web service layer that Silverlight can talk to. On the client side proxy classes are created to interact with the service layer. RIA Data Services is designed to make it appear as if you are interrogating EF directly.
To use EF without RIA services you can create a basic service class and have all your business logic in it, and from within this service you can use Entity Framework. You would make calls to this service layer just like any other service.
Related
I have:
- some count of Silverlight Web applications, hosted on different IIS virtual directories.
One Application has WCF RIA Services, which part of functionality I want to share between all these SL applications
How to do this?
I have idea to create WCF RIA service library, which referenced to WCF RIA Services host and have needed functionality to clients. But If I will create references to this DLL from my different solutions, how this DLL (WCF RIA Services Library) known, where address (endpoint) of this WCF host?
For example, WCF RIA is hosted on http:\webapps\UserManager
and SL aplpication is hosted on http:\webapps\ClientApp
There is no spoon... and there are no fully-qualified Endpoints with RIA services by default...
When you link the .web RIA class library projects to your main web project, the services are accessed behind the scenes by URLs like:
http://localhost:2911/ClientBin/RiaServices-Documents-Web-DocumentDomainService.svc/binary/GetDocuments?$take=20&$includeTotalCount=True
The client RIA class library projects just assume a relative URL (relative to the hosting project), so they will work in any Silverlight application.
To use a RIA service from another location, other than the hosting website, you need to specify the service Endpoint manually in the DomainContext constructor:
DocumentDomainContext d = new DocumentDomainContext("http:someotherserver:1234//ClientBin/RiaServices-Documents-Web-DocumentDomainService.svc");
(I do not know how to do this for a Domain Data Source).
I have an integration test suite in silverlight that requires an http server and a socket server.
What I've been thinking to do is to control the suite from silverlight through a WCF RIA service.
I would like to know how to start those servers (They are already coded in c# and can be run seperately) whenever the WCF service starts?
IF the WCF service is hosted in IIS ASP.NET, you can use Application_Start in Global.asax to trigger starting the other services.
If you host the WCF service in a console app or Windows service, then of course that is where you would call the code to start up those external services.
Building a WPF XBAP based application, I need to access data in my hosted SQLServer DB (Shared hosting).
Therefore I need to create a WCF LINQ based service.
Anyone knows of a simple end-to-end tutorial demonstrating how to build the service and install it on the hosted webserver?
I've found several but either they are ASP.NET or Silverlight dedicated, either they are far from comprehensive...
Please do not answer with ASP.NET solutions... I need WPF.
Thanks in advance.
Consider using RIA Services for your scenario (calling the services from WPF rather than Silverlight).
See this StackOverflow question for references on how to call RIA Services from WPF: How to use WCF RIA SERVICES with WPF application?
Im totally new to WCF. Trying to create a Silverlight application with WCF services.
Im not sure what address to fill in for adding the service reference for the client side.
Also, what do I need to specify in the Web config file in the server side?
Thanks.
There are a few different kinds of WCF Services. WCF Services, WCF Data Services & WCF RIA Services. For a bit of background on these types/kinds check out this forum entry.
If you are using just WCF Services, here's an intro and a sample and another sample that should get you going. :-)
Here's a great overview from Shawn Wildermuth on creating a WCF Data service & consuming it in various ways.
WCF RIA Services are specifically built/optimized for Silverlight. If you are in control of the Service as well you might want to look into creating a RIA Service instead of just a WCF Data Service. Here's an intro to RIA Services.
At MIX it was announced that WCF RIA Services supports OData Endpoint on the server now.
But is there also a good way to consume data from an OData Server in the WCF RIA Services Tooling also now?
According to Brad Abrams' blog, RIA Services can expose their data as OData, have a look.