我正在尝试将新的ASP.NET 5配置构建器用于以下对象。有人知道数组类型字段的JSON语法吗?
public class ProjectConfiguration
{
public ProjectSubfolder[] ProjectSubfolders { get; set; }
}
public class ProjectSubfolder
{
public string Name { get; set; }
public ProjectPermission[] ProjectPermissions { get; set; }
}
public class ProjectPermission
{
public string Identity { get; set; }
public FileSystemRights FileSystemRights { get; set; }
public InheritanceFlags InheritanceFlags { get; set; }
public PropagationFlags PropagationFlags { get; set; }
public AccessControlType AccessControlType { get; set; }
}我使用的json无法填充ProjectConfiguration.ProjectSubfolders数组,如下所示:
{
"ProjectConfiguration": {
"ProjectSubfolders": [
{
"Name": "MyName",
"ProjectPermissions": [
{
"Identity": "Domain\\ShortId",
"FileSystemRights": "FileSystemRights.CreateDirectories",
"InheritanceFlags": "InheritanceFlags.None",
"PropagationFlags": "PropagationFlags.NoPropagateInherit",
"AccessControlType": "AccessControlType.Allow"
}
]
}
]
}
}发布于 2015-12-18 01:41:59
Epic自身失败,当从原始的基于XML序列化程序的实现转换时,复制/粘贴工作在值上留下了System.Security.AccessControl类型名称的前缀。
"FileSystemRights": "FileSystemRights.CreateDirectories"应该是
"FileSystemRights": "CreateDirectories"https://stackoverflow.com/questions/34340548
复制相似问题