title: Conditional to limit .Net webservice results
body: <p>I'm not sure if this is the right way but I have a web service that returns json. Now I wanted to set a conditional to omit rows returned that have a value of false in cell appearInShowcase. Most of the code is pretty straight forward what it does but the cell that has a true false value is appearInShowcase which is in a table photo. In the ms sql database the appearInShowcase is of type ntext.</p>
  
  <pre><code>    public List&lt;wsGalleryPhotos&gt; GetGalleryPhotos(int collectionID)
      {
         photoDataContext dc = new photoDataContext();
  
          List&lt;wsGalleryPhotos&gt; results = new List&lt;wsGalleryPhotos&gt;();
          System.Globalization.CultureInfo ci = System.Globalization.CultureInfo.GetCultureInfo("en-US");
  
          foreach (photo photo in dc.photos.Where(s =&gt; s.collectionID == collectionID)) 
          {
              if(photo.appearInShowcase == "true")
              {
              results.Add(new wsGalleryPhotos()
              {   
  
                  photoID = photo.photoID,
                  collectionID = Convert.ToInt32(photo.collectionID),
                  name = photo.name,
                  description = photo.description,
                  filepath = photo.filepath,
                  thumbnail = photo.thumbnail
  
  
              }); 
              }
          }
  
          return results;
      } 
  </code></pre>