Created
March 10, 2011 16:42
Revisions
-
Tim Jones created this gist
Mar 10, 2011 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,30 @@ public class Asset : Document<Asset> { public string Title { get; set; } public Attachment File { get; set; } } Attachment file = Attachment.Create("Files/Koala.jpg", "image/jpg"); Asset asset = new Asset { Title = "The Title", File = file }; asset.Save(); /* { "_id": { "$oid": "4d78ff2002df531d487fdbcc" }, "_t": "Asset", "Title": "The Title", "File": { "$oid": "4d78ff1f02df531d487fdbc6" } } */ Asset theAsset = Asset.FindByID(asset.ID); string fileName = theAsset.File.FileName;