Quantcast
Channel: C1 CMS Foundation - Open Source on .NET
Viewing all articles
Browse latest Browse all 2540

New Post: Store media in MS SQL database

$
0
0
Have you tried this?
 using (DataConnection connection = new DataConnection())
 {
   var subfiles = (from f in connection.Get<Composite.Media.DBMediaFile>()
                         where f.FolderPath.Contains(oldFolder + "/")
                         select f).ToList();
                
  foreach (var file in subfiles)
  {
      file.FolderPath = newFolder;
      connection.Update<Composite.Media.DBMediaFile>(file);
    }
}
(notice the .ToList() on line 5)

Viewing all articles
Browse latest Browse all 2540

Trending Articles