Hello guys,
I'm trying to find a way to do the following psudo:
void foo(int iArea, int iCity)
{
  using (myDataContext  context = new myDateContext)
  {
    var query =
      from ad in context.Ads
      join publisher in cintext.Publishers on ad.PublisherID equals
publisher.ID
      select new
      {
        adDate = ad.Date,
        adText = ad.Text,
        adArea = ad.Area
      }
      if (iArea > 0)
      {
        query.Where(ad=>ad.adArea.Contains(";"+iArea.ToString()+";");
      }
      else
      {
        query.Where(ad=>ad.CityID == iCity);
      }
      foreach (var _query in query)
      {
        ...//do something here
      }
  }
}

I can't find a way to do the check if the area code is contained iside
the string if the adArea from the DB.
is there any way to do it?

-- 
You received this message because you are subscribed to the Google Groups 
"DbLinq" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/dblinq?hl=en.

Reply via email to