I'm trying to use Linq to SharePoint to save a new record in my list. I provided my own List definition for which I have 2 resource files that are giving the good list names (French and English).
When I browse my site in the English UI for my list "Videos", everything works fine, I can insert my new item in my list, my DataContext finds the correct list.
When I browse my site in the French UI, when the DataContext is trying to create the new record, an exception is thrown because it says it cannot find the "Vidéos" list.
The weird part, is that it works for other lists (only need to read data from those lists...).
Do I need a special DataContext?
Here's the failing code :
Video video = new Video()
{
Title = inputFile.PostedFile.FileName,
VideoUniqueIdentifier = newFileGuid.ToString("B")
};
// dc.GetList<Video>("Vidéos").InsertOnSubmit(video); // Fails
dc.Videos.InsertOnSubmit(video); // Passes, using the SPMetal provided value "Videos"
dc.SubmitChanges(); // Fails in french, passes in english