foreach (var part in configuredProduct.Parts) { part.ProductConstraints = constraints.Result.Parts.First(p => p.Part == part.Name).ProductConstraints; }
public Dictionary<string, Dictionary<string, List<ProductConstraintOutput>>> ProductConstraints { get; set; } = new Dictionary<string, Dictionary<string, List<ProductConstraintOutput>>>();
如上代码,想改变foreach迭代变量的属性:ProductConstraints
断点走到结尾大括号时,foreach迭代变量:part 的 ProductConstraints是有值的
但是configuredProduct.Parts中的 ProductConstraints 却还是Count=0
configuredProduct