12 个问题
你好,
您是否要求 C# 结构来支持您提供的 JSON? 每个大括号代表一个映射到 C# 类的 JSON 对象。 方括号是 JSON 中的数组,因此它们映射到数组或 C# 中的“IEnumerable<T>”。 其他一切都只是简单的原始映射。
public class Organization
{
public string dataType { get; set; }
public OrganizationData organizationData { get; set; }
}
public class OrganizationData
{
public int organizationNPI { get; set; }
public string organizationName { get; set; }
public string organizationTIN { get; set; }
public string website { get; set; }
public IEnumerable<Location> location { get; set; }
}
public class Location
{
public string addressLine1 { get; set; }
public string addressLine2 { get; set; }
public string city { get; set; }
public string state { get; set; }
public IEnumerable<Contact> contact { get; set; }
}
public class Contact
{
public string firstName { get; set; }
public string lastName { get; set; }
public string middleName { get; set; }
public string email { get; set; }
public string phone { get; set; }
}
如果答案是正确的解决方案,请单击“接受答案”并请投赞成票。如果您对此答案有其他疑问,请点击“评论”。
注意:如果您想接收此线程的相关电子邮件通知,请按照我们文档中的步骤启用电子邮件通知。
最好的问候