私は以下のようにリフレクションを使用してPDFフォームに記入しようとしています:
// Get the form fields for this PDF and fill them in!
var formFieldMap = GetFormFieldNames(pdfTemplate);
foreach (var fields in formFieldMap)
{
var fieldName = UppercaseFirst(fields.Key.Replace("pdf_", ""));
var proPertyValue = fosques.GetType().GetProperty(fieldName).GetValue(ques, null);
formFieldMap[fields.Key] = proPertyValue.ToString();
}
これは最初のプロパティでは正常に機能しますが、2回目の反復ではCollection was modified; enumeration operation may not execute.
別のフィールドのコレクションを作成する必要がありますか、それともこれを回避できますか?