Changing metadata

The session keeps track of all the files loaded into the session context. If you want to change the file's metadata, you just need to modify it and save changes.


FileHeader file = await session.LoadFileAsync("/movies/intro.avi");

file.Metadata["Copyright"] = "2015 Hibernating Rhinos. All rights reserved."; // modification of existing metadata
file.Metadata.Add("Duration", TimeSpan.FromMinutes(22).ToString()); // adding a new one

await session.SaveChangesAsync();