var svc = new LocationDataServiceContext();
var q = from c in svc.LocationTable
where c.ID == int.Parse(location.ID)
select c;
if (q.ToArray().Length == 0)
id there a neater way to do this?
var svc = new LocationDataServiceContext();
var q = from c in svc.LocationTable
where c.ID == int.Parse(location.ID)
select c;
if (q.ToArray().Length == 0)
id there a neater way to do this?
yes, I believe so...
var svc = new LocationDataServiceContext();
if (svc.LocationTable.SingleOrDefault(c => c.ID == int.Parse(location.ID) != null))
{
}
I thought there was an Exist() method... but I guess not.