It\'s well known that you cannot set foreign key IDs directly in Linq to SQL if the entities have already been loaded. You can however look up the entity by it\'s foreign k
I typically put these methods in the partial class for the DataContext, on the theory that these methods are similar to stored procedures in some sense, and stored procedures are manifested as methods on the DataContext.
Whichever way you decide to proceed, it's definitely worth refactoring so that you have this query in only one place and don't repeat yourself. This also leaves you the option of replacing the simple method you've described with a more sophisticated one that caches a compiled version of the query and reuses it, without having to update all the callers of the method.