如何初始化屬性值,我有以下代碼:取決於另一個propertey
var workOrderList = new List<WorkOrder>(
from index in Enumerable.Range(1, orders.Length)
select new WorkOrder
{
OrderID = orders[index - 1],
Status = status[random.Next(0,status.Length-1)],
TotalQuantity = random.Next(1, 5) * 8,
ScheduleCollection = new ObservableCollection<Schedule>
{
new Schedule
{
Color = colors[random.Next(0,colors.Length-1)],
Model = models[random.Next(0,models.Length-1)],
Status = status[random.Next(0,status.Length-1)],
TotalNumber = To be Updated bases on Total Quantity
}
}
現在,我想無論是分或減去值從TotalQuantity更新總數。
我找不到讓你的代碼 – Simsons
看第三行的任何地方... – shambulator