문제

I have a SPO site with some DocumentSets having different ContentType. I need to get "Allowed Content Types" of any DocumentSet to take a decision: I get my DocumentSet as ListItem or as Folder or as DocumentSet (Microsoft.SharePoint.Client.DocumentSet) but, in any form it is, I can't find a way to reach the allowed Content Types, any advice?

Thanks in advance.

도움이 되었습니까?

해결책

You should be able to get it through the UniqueContentTypeOrder property. Here's the part of the code that I used in one of the proejcts to get those values:

var docset = web.GetFolderByServerRelativeUrl("DOCUMENTSETURL");
context.Load(docset);
context.Load(docset, l=> l.UniqueContentTypeOrder); 
context.ExecuteQuery();

foreach(var ctid in docset.UniqueContentTypeOrder)
{
    Console.WriteLine(ctid);
}    
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 sharepoint.stackexchange
scroll top