我有一个列表项,我将这个列表项多次添加到列表中,但有一个属性差异……即列表项具有 DateOfService 属性……k……然后我将第一项添加到列表中……很好,我正在改变DateOfService 属性并再次添加...但之前添加的项目 DateOfService 也在改变....我该如何克服这个问题...
示例代码
if (bills[index].FrequencyId == Convert.ToInt32(Frequency.Daily))
{
for (int day = 0; day < remainedDays; day++)
{
bills[index].DateOfService = DateTime.Now.Date.AddDays(day).Date;
remainedBills.Add(bills[index]);
}
}
嗨,我也这样做了,但没有用...
if (bills[index].FrequencyId == Convert.ToInt32(Frequency.Daily))
{
AdmissionEntryVo objAdmissionEntryVo = null;
for (int day = 0; day < remainedDays; day++)
{
objAdmissionEntryVo = new AdmissionEntryVo();
objAdmissionEntryVo = bills[index];
objAdmissionEntryVo.DateOfService = DateTime.Now.Date.AddDays(day).Date;
remainedBills.Add(objAdmissionEntryVo);
}
}