我有这个Json,我无法控制以下结构:
public class RootObject
{
public string id { get; set; }
public string name { get; set; }
public string type { get; set; }
// TypeBlock
//...
// AddressBlock
//...
// DayBlock
public bool exceptionalDay_2018_05_01 { get; set; }
public bool? exceptionalDay_2018_05_05 { get; set; }
public bool? exceptionalDay_2018_05_06 { get; set; }
public bool? exceptionalDay_2018_05_08 { get; set; }
public bool exceptionalDay_2018_05_10 { get; set; }
public bool? exceptionalDay_2018_05_13 { get; set; }
public bool? exceptionalDay_2018_05_20 { get; set; }
public bool exceptionalDay_2018_05_21 { get; set; }
public bool? exceptionalDay_2018_05_27 { get; set; }
}
问题很简单,不工作日会发送给我在excellentDay Property。
每次我查询当月的工作日都是计算和发送有属性。
如何处理每个月会改变的财产?
也许选择那些更通用的类型,如:
public class RootObject
{
public string id { get; set; }
public string name { get; set; }
public string type { get; set; }
// TypeBlock
//...
// AddressBlock
//...
// DayBlock // .Where( property == true )
public List<DateTime> exceptionalDays { get; set; }
}