SilverlightShow: Building N-Tier business applications with WCF RIA Services – Part II Comments http://www.silverlightshow.net/ Silverlight articles, Silverlight tutorials, Silverlight videos, Silverlight samples SilverlightShow.net http://www.rssboard.org/rss-specification Argotic Syndication Framework 2008.0.2.0, http://www.codeplex.com/Argotic en-US estoychev@completit.com (Emil Stoychev) Re: Building N-Tier business applications with WCF RIA Services – Part II <p>Hello Zoltan,</p> <p>Just a simple question regards the entitycollection: <span class="kwrd" style="color: #0000ff;">public</span> EntityCollection<Products> Products;</p> <p>can we have a client side validation on that collection to check for duplicates in entity entries or something like that using the shared.cs files after decorating the property with the <span style="font-family: consolas; color: #008000; font-size: 13px;">[CustomValidation(typeof(CustomDailyValidation), "ValidateDuplicateIds")</span>] attribute?</p> <p>so the final result qould be :</p> <div class="reCodeBlock" style="overflow-y: auto;border: #7f9db9 1px solid;"> <div style="background-color: #fff;"><span style="margin-left: 0px !important;"><code style="color: #000;">[CustomValidation(</code><code style="color: #069; font-weight: bold;">typeof</code><code style="color: #000;">(CustomValidation), </code><code style="color: blue;">"ValidateDuplicateIds"</code><code style="color: #000;">)]  </code></span></div> <div style="background-color: #f8f8f8;"><span style="margin-left: 0px !important;"><code style="color: #069; font-weight: bold;">public</code> <code style="color: #000;">EntityCollection<Products> Products; </code></span></div> </div> <p>If you can give a small example would be great.</p> <p>Regards</p> <p>Waleed</p> <p> </p> http://www.silverlightshow.net/items/Building-N-Tier-business-applications-with-WCF-RIA-Services-Part-II.aspx#comment6386 WaleedSeada http://www.silverlightshow.net/items/Building-N-Tier-business-applications-with-WCF-RIA-Services-Part-II.aspx Sat, 30 Jul 2011 22:22:31 GMT RE: Building N-Tier business applications with WCF RIA Services – Part II <p>Rüdiger: No charts here or RIA Services, just plain old WCF, and POCO  with SL + MVVM (didn't even touch a real persistance layer) I think it show the concepts you need in your above example.</p> <p><a href="http://www.silverlightshow.net/items/Data-Driven-Applications-with-MVVM-Part-I.-The-Basics.aspx">http://www.silverlightshow.net/items/Data-Driven-Applications-with-MVVM-Part-I.-The-Basics.aspx</a></p> http://www.silverlightshow.net/items/Building-N-Tier-business-applications-with-WCF-RIA-Services-Part-II.aspx#comment3988 zoltan.arvai http://www.silverlightshow.net/items/Building-N-Tier-business-applications-with-WCF-RIA-Services-Part-II.aspx Wed, 14 Jul 2010 14:37:27 GMT RE: Building N-Tier business applications with WCF RIA Services – Part II <p>1. I have lots of business functions residing on the server in Plain Old CLR Objects (simple objects and collections). What I am looking for is an example using WCF/RIA for the client-server part. Does anyone have a URL?</p> <p>2. We always see the database loading examples, and I am thankful to those providing these; </p> <p>However, what I think would be interesting is to see e.g. a SL treeview in MVVM in concert with a SL interactive chart in MVVM which could be bound to an observable collection that automatically updates server data via WCF using a custom (POCO) object structure, and only in the end accessing the data layer with either DataSet or EF or SQL connection.</p> <p> </p> http://www.silverlightshow.net/items/Building-N-Tier-business-applications-with-WCF-RIA-Services-Part-II.aspx#comment3987 Rüdiger http://www.silverlightshow.net/items/Building-N-Tier-business-applications-with-WCF-RIA-Services-Part-II.aspx Wed, 14 Jul 2010 12:00:07 GMT RE: Building N-Tier business applications with WCF RIA Services – Part II Mr Promo. You dont have to go with the generated code if you don't want to... You can write it from ground up. http://www.silverlightshow.net/items/Building-N-Tier-business-applications-with-WCF-RIA-Services-Part-II.aspx#comment3806 zoltan.arvai http://www.silverlightshow.net/items/Building-N-Tier-business-applications-with-WCF-RIA-Services-Part-II.aspx Wed, 16 Jun 2010 15:22:23 GMT RE: Building N-Tier business applications with WCF RIA Services – Part II <p>Hi Andy!</p> <p>I'm not really executing business logic on the client side... What I actually do is download data from the server and passing it to he silverlight client to present it on the UI. I think using linq queries are pretty natural by now. While in simple WCF you have to write all the operations (get operations) to just get what you want, in WCF RIA Services, you don't have to do that. You can tell on the client what exactly do you need. (Of course it has constraints). The query by the way runs on the server, you just get the results. I'm pretty sure that's not conflicting with n-tier concepts. (We have presentation tier and a WCF (service layer) as well, and an EF provides DAL like ORM layer:) Definitely not so clear as your solution however your approach takes a lot of extra work to develop. This is out of the box.</p> http://www.silverlightshow.net/items/Building-N-Tier-business-applications-with-WCF-RIA-Services-Part-II.aspx#comment3805 zoltan.arvai http://www.silverlightshow.net/items/Building-N-Tier-business-applications-with-WCF-RIA-Services-Part-II.aspx Wed, 16 Jun 2010 15:21:32 GMT RE: Building N-Tier business applications with WCF RIA Services – Part II After looking at all the stringent requirements and after seeing all the codgen create by these projects, all i have to say is, this technology will never last. Thanks http://www.silverlightshow.net/items/Building-N-Tier-business-applications-with-WCF-RIA-Services-Part-II.aspx#comment3709 Mr. Pomo http://www.silverlightshow.net/items/Building-N-Tier-business-applications-with-WCF-RIA-Services-Part-II.aspx Thu, 03 Jun 2010 01:33:47 GMT RE: Building N-Tier business applications with WCF RIA Services – Part II <p>Hi, I'm probably missing something here as I'm trying to understand the difference between a "conventional" WCF service as would be used in an ASP.Net app (pre-VS2010), and an RIA service, where domain services fit in, etc.</p> <p>In your article under the heading "Simple Query Model" you demonstrate a client-side LINQ query to retrieve products. Surely this isn't n-tier is it - i.e. executing business logic client side? I'm from an ASP.Net background and would normally develop a business tier (WCF service), exposing an operation such as "GetProductsForCategory(string categoryName)", that the client side would call. I'm a little confused as to why you would be executing a query on the client side.</p> <p>Thanks in advance</p> <p>Andy</p> http://www.silverlightshow.net/items/Building-N-Tier-business-applications-with-WCF-RIA-Services-Part-II.aspx#comment3638 Andy http://www.silverlightshow.net/items/Building-N-Tier-business-applications-with-WCF-RIA-Services-Part-II.aspx Wed, 19 May 2010 20:57:37 GMT RE: Building N-Tier business applications with WCF RIA Services – Part II <p>Lou: You have to add the [Include] attribute on top of the property (association) in the metadata class. And you also have to load it from the database / datasource and pass the data back aslo to the client side.</p> <p>RAM: The short answer is yes, of course :)</p> http://www.silverlightshow.net/items/Building-N-Tier-business-applications-with-WCF-RIA-Services-Part-II.aspx#comment3359 Zoltan Arvai http://www.silverlightshow.net/items/Building-N-Tier-business-applications-with-WCF-RIA-Services-Part-II.aspx Wed, 07 Apr 2010 03:44:02 GMT RE: Building N-Tier business applications with WCF RIA Services – Part II Hi, <p> </p> I am new to .net and this posting was realy very informative , thankyou. <p> </p> <p>got a dump question though, in your example </p> <p> </p> <div class="csharpcode" id="codeSnippet"> <pre class="alt">NorthwindDomainContext ctx = <span class="kwrd" style="color: #0000ff;">new</span> NorthwindDomainContext();</pre> <!--CRLF--> <pre class="alteven"> </pre> <!--CRLF--> <pre class="alt">var query = from p <span class="kwrd" style="color: #0000ff;">in</span> ctx.GetProductsQuery()</pre> <!--CRLF--> <pre class="alteven"> <span class="kwrd" style="color: #0000ff;">where</span> p.Categories.CategoryName == <span class="str" style="color: #006080;">"Beverages"</span></pre> <!--CRLF--> <pre class="alt"> select p;</pre> <!--CRLF--> <pre class="alteven"> </pre> <!--CRLF--> <pre class="alt">ctx.Load<Products>(query);</pre> <!--CRLF--> <pre class="alteven"> </pre> <!--CRLF--> <pre class="alt">productDataGrid.ItemsSource = ctx.Products;</pre> </div> <p> </p> where does the filteration of data occurs server side or client side, <p> </p> <p>does the service return complete product table data to client and client applies the filter or is .Net smart enough to send the query to the server and apply the filter on server itself.</p> <p>thanks</p> <p>ram </p> http://www.silverlightshow.net/items/Building-N-Tier-business-applications-with-WCF-RIA-Services-Part-II.aspx#comment3356 RAM http://www.silverlightshow.net/items/Building-N-Tier-business-applications-with-WCF-RIA-Services-Part-II.aspx Tue, 06 Apr 2010 15:27:41 GMT RE: Building N-Tier business applications with WCF RIA Services – Part II In this example Products are being included in the Category. <div>What if the Category has a related EntityCollection.</div> <div><br /> </div> <div>In my case I have Customers, Dogs and the Dogs have related vaccinations. I can select a customer and get the related dogs, however I can not get the related vaccinations, is there a way to get the data that is related to the related data?</div> http://www.silverlightshow.net/items/Building-N-Tier-business-applications-with-WCF-RIA-Services-Part-II.aspx#comment3122 Lou http://www.silverlightshow.net/items/Building-N-Tier-business-applications-with-WCF-RIA-Services-Part-II.aspx Thu, 25 Feb 2010 02:18:39 GMT RE: Building N-Tier business applications with WCF RIA Services – Part II <p>Dear Trung Hoang,</p> <p>Do you use MyISAM tables in your MySQL database?</p> <p>I just created a MySQL database and default all new tables are created using MyISAM which, indeed, doesn't support Foreign keys. </p> <p>But if you switch all tables to use the InnoDB engine instead, you'll be able to create foreign keys and use them in your RIA app with Entity Model.</p> <p>I am in preparation of a article regarding RIA services, Silverlight and MySQL databases on my <a href="http://www.radupoenaru.com/" target="_blank" title="Radu Poenaru's website">website</a>, because I faced this issue on my own and I believe that it is very interesting to share this. </p> <p></p> <p> </p> http://www.silverlightshow.net/items/Building-N-Tier-business-applications-with-WCF-RIA-Services-Part-II.aspx#comment3119 Radu Poenaru http://www.silverlightshow.net/items/Building-N-Tier-business-applications-with-WCF-RIA-Services-Part-II.aspx Wed, 24 Feb 2010 13:59:40 GMT RE: Building N-Tier business applications with WCF RIA Services – Part II Thanks for the interesting post. I am using MySQL as backend database for my project. I wonder if there is any custom way to implement the so called "<span style="font-family: consolas, 'courier new', courier, monospace; font-size: 11px; line-height: 16px; white-space: pre; ">[Include]<span style="font-family: 'times new roman'; line-height: normal; white-space: normal; font-size: medium; ">" so I can also load the related entities because,  you know, MySQL don not support foreign keys or specifically associations in the Entity Model using in RIA.</span></span><br /> <div><span style="font-family: 'times new roman'; line-height: normal; white-space: normal; font-size: medium; "><br /> </span></div> <div><span style="font-family: 'times new roman'; line-height: normal; white-space: normal; font-size: medium; ">Regards,</span></div> <div>Trung Hoang</div> http://www.silverlightshow.net/items/Building-N-Tier-business-applications-with-WCF-RIA-Services-Part-II.aspx#comment3008 middlevn http://www.silverlightshow.net/items/Building-N-Tier-business-applications-with-WCF-RIA-Services-Part-II.aspx Thu, 28 Jan 2010 05:32:15 GMT