问题
I am writing a console application to read content from my umbraco database. I am unable to get following simple code to work
var doc = new Document(1081);
Console.WriteLine("Package Id: {0}", doc.getProperty("packageId").Value);
There is a document in Umbraco and I have created content against that document. The content node is published and has id of 1081. The first line works fine and returns me the correct content node but second line fails to retrieve the property named packageId
. There is a property with this name on the document type and I can see this value in the xml of the content node in cmsContentXml
table in Umbraco database.
Is running this inside a console application a problem? I do not seem me to think so otherwise the first line of code would not have worked either.
来源:https://stackoverflow.com/questions/20358594/umbraco-try-to-read-document-properties-programatically-but-always-getting-nul