If you are recieving the generic error "Sequence contains no elements." it is because LINQ creates an InvalidOperationException when you are looking for a record that doesn't exist. Your code may look something like...
return this.DataContext.MyRecords.Single([expression]);return (from record in DataContext.MyRecords where [someCondition] select record).Single();
In place of of Single, you can alternatively use SingleOrDefault, which will return null if the object doesn't exist.
return this.DataContext.MyRecords.SingleOrDefault([expression]);return (from record in DataContext.MyRecords where [someCondition] select record).SingleOrDefault();