Note that there are some explanatory texts on larger screens.

plurals
  1. POConsuming WCF from other projects
    text
    copied!<p>I'm very new to silverlight and WCF Ria services. I have background experience in WPF and WinForms.</p> <p>Right now I'm developing a silverlight application that consists basically on a web page fetching data from a remote server.</p> <p>I've read tons of forums and articles that explain how to use and consume web services and WCF. I've followed the <a href="http://msdn.microsoft.com/en-us/library/ee707376%28v=vs.91%29.aspx" rel="nofollow">msdn walkthrough</a> on how to create a simple app that gets data from a DB and it worked great.</p> <p>The problem is that I don't want any WCF related code or resource in my UI controls. Right now I'm using using the layered programming architecture:</p> <p>UI --> BLL --> DAL</p> <p>Each of these elements is a single project in the same solution. My DAL project is the web service (WCF Ria) that comunicates with the server.</p> <p>I have a simple class (User Service) and method (GetUsers) in my DAL project with the following code:</p> <pre><code> LoadOperation&lt;u_WEBUSERS&gt; loadOp = this.userContext.Load(this.userContext.GetU_WEBUSERSQuery()); loadOp.Completed += (sender, args) =&gt; { users = new List&lt;UserObj&gt;(); foreach (var v in loadOp.Entities) { u_WEBUSERS uweb = v as u_WEBUSERS; UserObj u = new UserObj(); u.Nome = uweb.nome; u.Morada = uweb.morada; users.Add(u); } }; return users; </code></pre> <p>The thing is that my users object returns null. If I breakpoint I see that first is ending the method and only after is calling the completed event.</p> <p>Is there any way make my GetUsers() to return the data base information? Maybe the layered achitecture that I'm using isn't the one suited for what I want... Thanks</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload