<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments for Tek Freak</title>
	<atom:link href="http://powerbala.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://powerbala.com</link>
	<description>Switched ON</description>
	<lastBuildDate>Tue, 14 Feb 2012 21:26:55 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>Comment on Calling a 3rd Party Web Service From LightSwitch by powerbala</title>
		<link>http://powerbala.com/2011/04/16/calling-a-3rd-web-service-from-lightswitch/#comment-125</link>
		<dc:creator><![CDATA[powerbala]]></dc:creator>
		<pubDate>Tue, 14 Feb 2012 21:26:55 +0000</pubDate>
		<guid isPermaLink="false">http://powerbala.com/?p=96#comment-125</guid>
		<description><![CDATA[Jan,
If I&#039;m right, LS works exactly the way RIA is supposed to. Soon it updates a record, it is trying to update its client records for concurrency issues, which is why it calls Default parameterless query.  Why &quot;Parameterless Method&quot; is questionable, but thats what LS requires (we definitely need a parameterless method).  I usually leave my Default Query blank.]]></description>
		<content:encoded><![CDATA[<p>Jan,<br />
If I&#8217;m right, LS works exactly the way RIA is supposed to. Soon it updates a record, it is trying to update its client records for concurrency issues, which is why it calls Default parameterless query.  Why &#8220;Parameterless Method&#8221; is questionable, but thats what LS requires (we definitely need a parameterless method).  I usually leave my Default Query blank.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Calling a 3rd Party Web Service From LightSwitch by Jan</title>
		<link>http://powerbala.com/2011/04/16/calling-a-3rd-web-service-from-lightswitch/#comment-124</link>
		<dc:creator><![CDATA[Jan]]></dc:creator>
		<pubDate>Mon, 06 Feb 2012 10:13:47 +0000</pubDate>
		<guid isPermaLink="false">http://powerbala.com/?p=96#comment-124</guid>
		<description><![CDATA[hi, thank you for this excellent example.

I have a question:
When I create my custom domain service (to consume 3rd party web service) where I use parametrized CRUD methods everything works, except creating a new record.
Lightswitch adds this domain service as a datasource and is able to create a screen for adding new record. When I click the &quot;Save&quot; button in generated application, it correctly calls the Create method on domain service, the record is correctly created by remote web service and the program is leaving the Create method on a domain service. but suddenly the lightswitch calls the default query method, which is non parametrized and returning a Enumerable in my case. 
It seems like lightswitch is trying to re-read the yet created record to display it. But it does not use a proper ReadOne method, which is correctly prepared, created and even recognized by lightswitch, because it is able to call it on an other detail screen.

Why does Lightswitch call this [Query(IsDefault=true)] method please?

thank you for any hints

h]]></description>
		<content:encoded><![CDATA[<p>hi, thank you for this excellent example.</p>
<p>I have a question:<br />
When I create my custom domain service (to consume 3rd party web service) where I use parametrized CRUD methods everything works, except creating a new record.<br />
Lightswitch adds this domain service as a datasource and is able to create a screen for adding new record. When I click the &#8220;Save&#8221; button in generated application, it correctly calls the Create method on domain service, the record is correctly created by remote web service and the program is leaving the Create method on a domain service. but suddenly the lightswitch calls the default query method, which is non parametrized and returning a Enumerable in my case.<br />
It seems like lightswitch is trying to re-read the yet created record to display it. But it does not use a proper ReadOne method, which is correctly prepared, created and even recognized by lightswitch, because it is able to call it on an other detail screen.</p>
<p>Why does Lightswitch call this [Query(IsDefault=true)] method please?</p>
<p>thank you for any hints</p>
<p>h</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Calling a 3rd Party Web Service From LightSwitch by Berney</title>
		<link>http://powerbala.com/2011/04/16/calling-a-3rd-web-service-from-lightswitch/#comment-123</link>
		<dc:creator><![CDATA[Berney]]></dc:creator>
		<pubDate>Sun, 05 Feb 2012 07:53:44 +0000</pubDate>
		<guid isPermaLink="false">http://powerbala.com/?p=96#comment-123</guid>
		<description><![CDATA[nm...brain fart]]></description>
		<content:encoded><![CDATA[<p>nm&#8230;brain fart</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Calling a 3rd Party Web Service From LightSwitch by Berney</title>
		<link>http://powerbala.com/2011/04/16/calling-a-3rd-web-service-from-lightswitch/#comment-122</link>
		<dc:creator><![CDATA[Berney]]></dc:creator>
		<pubDate>Sun, 05 Feb 2012 07:33:05 +0000</pubDate>
		<guid isPermaLink="false">http://powerbala.com/?p=96#comment-122</guid>
		<description><![CDATA[What is the leftover project without the .web in the name for and can it be safely removed?]]></description>
		<content:encoded><![CDATA[<p>What is the leftover project without the .web in the name for and can it be safely removed?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Calling a 3rd Party Web Service From LightSwitch by Berney</title>
		<link>http://powerbala.com/2011/04/16/calling-a-3rd-web-service-from-lightswitch/#comment-121</link>
		<dc:creator><![CDATA[Berney]]></dc:creator>
		<pubDate>Sat, 04 Feb 2012 23:25:12 +0000</pubDate>
		<guid isPermaLink="false">http://powerbala.com/?p=96#comment-121</guid>
		<description><![CDATA[Never a fan of rabbit holes. Wrapping my head around RIA Services was enough. Converting this sample to VB.Net was another ordeal becsause of the Yield / Iterator.

Hopefuly this snippet will help the next VB.Net user that comes along.


Option Compare Binary
Option Infer On
Option Strict On
Option Explicit On

Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.ComponentModel.DataAnnotations
Imports System.Linq
Imports System.ServiceModel.DomainServices.Hosting
Imports System.ServiceModel.DomainServices.Server
Imports System.Xml
Imports USZipCodeRIAService.Web.uszipcodewebref


Namespace USZipcodeRIAService.Web

    &#039;This node class to represent the webservice&#039;s output model
    Public NotInheritable Class WebServiceNode
        &#039;LS requires at least one Key field. So make Zip column as Key
        
        Public Property Zip() As String
        Public Property City() As String
        Public Property State() As String
        Public Property Area() As String
        Public Property TimeZone() As String

        &#039;return a new class
        Public Shared Function CreateNew(ByVal node As XmlNode) As WebServiceNode
            Return New WebServiceNode With {.City = node.ChildNodes(0).InnerText, .State = node.ChildNodes(1).InnerText, .Zip = node.ChildNodes(2).InnerText, .Area = node.ChildNodes(3).InnerText, .TimeZone = node.ChildNodes(4).InnerText}
        End Function
    End Class

    &#039;Data Helper
    Public NotInheritable Class Converter
        Public Shared Iterator Function SelectAllCities(ByVal xDoc As XmlNode) As IEnumerable(Of WebServiceNode)
            &#039;This enables the XmlNode Type to enumerate
            Dim cities As IEnumerator = xDoc.GetEnumerator()
            Do While cities.MoveNext()
                Yield WebServiceNode.CreateNew(CType(cities.Current, XmlNode))
            Loop
        End Function
    End Class

    Public Class ZipcodeDomainService
        Inherits DomainService
        &#039;LS requires a default parameterless query function
        &#039;or a skeleton class to return
        
        Public Function FakeFunction() As IEnumerable(Of WebServiceNode)
            Return SelectCity(&quot;&quot;)
        End Function

        &#039;This is the function we need to call from LS
        
        Public Function SelectCity(ByVal cityname As String) As IEnumerable(Of WebServiceNode)
            &#039;Instantiate USZip class from WebService Provider and pass city name
            Return Converter.SelectAllCities(New USZip().GetInfoByCity(cityname))
        End Function
    End Class
End Namespace]]></description>
		<content:encoded><![CDATA[<p>Never a fan of rabbit holes. Wrapping my head around RIA Services was enough. Converting this sample to VB.Net was another ordeal becsause of the Yield / Iterator.</p>
<p>Hopefuly this snippet will help the next VB.Net user that comes along.</p>
<p>Option Compare Binary<br />
Option Infer On<br />
Option Strict On<br />
Option Explicit On</p>
<p>Imports System<br />
Imports System.Collections.Generic<br />
Imports System.ComponentModel<br />
Imports System.ComponentModel.DataAnnotations<br />
Imports System.Linq<br />
Imports System.ServiceModel.DomainServices.Hosting<br />
Imports System.ServiceModel.DomainServices.Server<br />
Imports System.Xml<br />
Imports USZipCodeRIAService.Web.uszipcodewebref</p>
<p>Namespace USZipcodeRIAService.Web</p>
<p>    &#8216;This node class to represent the webservice&#8217;s output model<br />
    Public NotInheritable Class WebServiceNode<br />
        &#8216;LS requires at least one Key field. So make Zip column as Key</p>
<p>        Public Property Zip() As String<br />
        Public Property City() As String<br />
        Public Property State() As String<br />
        Public Property Area() As String<br />
        Public Property TimeZone() As String</p>
<p>        &#8216;return a new class<br />
        Public Shared Function CreateNew(ByVal node As XmlNode) As WebServiceNode<br />
            Return New WebServiceNode With {.City = node.ChildNodes(0).InnerText, .State = node.ChildNodes(1).InnerText, .Zip = node.ChildNodes(2).InnerText, .Area = node.ChildNodes(3).InnerText, .TimeZone = node.ChildNodes(4).InnerText}<br />
        End Function<br />
    End Class</p>
<p>    &#8216;Data Helper<br />
    Public NotInheritable Class Converter<br />
        Public Shared Iterator Function SelectAllCities(ByVal xDoc As XmlNode) As IEnumerable(Of WebServiceNode)<br />
            &#8216;This enables the XmlNode Type to enumerate<br />
            Dim cities As IEnumerator = xDoc.GetEnumerator()<br />
            Do While cities.MoveNext()<br />
                Yield WebServiceNode.CreateNew(CType(cities.Current, XmlNode))<br />
            Loop<br />
        End Function<br />
    End Class</p>
<p>    Public Class ZipcodeDomainService<br />
        Inherits DomainService<br />
        &#8216;LS requires a default parameterless query function<br />
        &#8216;or a skeleton class to return</p>
<p>        Public Function FakeFunction() As IEnumerable(Of WebServiceNode)<br />
            Return SelectCity(&#8220;&#8221;)<br />
        End Function</p>
<p>        &#8216;This is the function we need to call from LS</p>
<p>        Public Function SelectCity(ByVal cityname As String) As IEnumerable(Of WebServiceNode)<br />
            &#8216;Instantiate USZip class from WebService Provider and pass city name<br />
            Return Converter.SelectAllCities(New USZip().GetInfoByCity(cityname))<br />
        End Function<br />
    End Class<br />
End Namespace</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Many-To-Many Control for Microsoft LightSwitch by Jhon</title>
		<link>http://powerbala.com/2011/04/10/many-to-many-control-for-microsoft-lightswitch/#comment-106</link>
		<dc:creator><![CDATA[Jhon]]></dc:creator>
		<pubDate>Wed, 18 Jan 2012 03:12:30 +0000</pubDate>
		<guid isPermaLink="false">http://powerbala.com/?p=18#comment-106</guid>
		<description><![CDATA[mmmm yesterday the team LS release the solution, see this link:
 http://blogs.msdn.com/b/lightswitch/archive/2012/01/17/many-to-many-control-released.aspx]]></description>
		<content:encoded><![CDATA[<p>mmmm yesterday the team LS release the solution, see this link:<br />
 <a href="http://blogs.msdn.com/b/lightswitch/archive/2012/01/17/many-to-many-control-released.aspx" rel="nofollow">http://blogs.msdn.com/b/lightswitch/archive/2012/01/17/many-to-many-control-released.aspx</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Extending LightSwitch TextBox : Walk-Through by Kivito</title>
		<link>http://powerbala.com/2012/01/01/extending-lightswitch-textbox-walk-through/#comment-100</link>
		<dc:creator><![CDATA[Kivito]]></dc:creator>
		<pubDate>Thu, 12 Jan 2012 16:36:23 +0000</pubDate>
		<guid isPermaLink="false">http://powerbala.com/?p=292#comment-100</guid>
		<description><![CDATA[great stuff Bala! keep rockin!]]></description>
		<content:encoded><![CDATA[<p>great stuff Bala! keep rockin!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Many-To-Many Control for Microsoft LightSwitch by Darnell</title>
		<link>http://powerbala.com/2011/04/10/many-to-many-control-for-microsoft-lightswitch/#comment-98</link>
		<dc:creator><![CDATA[Darnell]]></dc:creator>
		<pubDate>Wed, 11 Jan 2012 14:08:14 +0000</pubDate>
		<guid isPermaLink="false">http://powerbala.com/?p=18#comment-98</guid>
		<description><![CDATA[The argument gets deleted.

after IEnumerable.]]></description>
		<content:encoded><![CDATA[<p>The argument gets deleted.</p>
<p>after IEnumerable.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Many-To-Many Control for Microsoft LightSwitch by Darnell</title>
		<link>http://powerbala.com/2011/04/10/many-to-many-control-for-microsoft-lightswitch/#comment-97</link>
		<dc:creator><![CDATA[Darnell]]></dc:creator>
		<pubDate>Wed, 11 Jan 2012 14:06:50 +0000</pubDate>
		<guid isPermaLink="false">http://powerbala.com/?p=18#comment-97</guid>
		<description><![CDATA[Sorry for the double post, the posts are being altered. There is an argument after IEnumerable: 
 public static IEnumerable   SelectGeneres(int? mID) if it hold up this time]]></description>
		<content:encoded><![CDATA[<p>Sorry for the double post, the posts are being altered. There is an argument after IEnumerable:<br />
 public static IEnumerable   SelectGeneres(int? mID) if it hold up this time</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Many-To-Many Control for Microsoft LightSwitch by Darnell</title>
		<link>http://powerbala.com/2011/04/10/many-to-many-control-for-microsoft-lightswitch/#comment-96</link>
		<dc:creator><![CDATA[Darnell]]></dc:creator>
		<pubDate>Wed, 11 Jan 2012 14:04:02 +0000</pubDate>
		<guid isPermaLink="false">http://powerbala.com/?p=18#comment-96</guid>
		<description><![CDATA[Update:
 The MovieGenre type did the trick. (public static IEnumerable SelectGenres(int? mID) etc… In case it may help someone else.]]></description>
		<content:encoded><![CDATA[<p>Update:<br />
 The MovieGenre type did the trick. (public static IEnumerable SelectGenres(int? mID) etc… In case it may help someone else.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

