我有一个包含列复选框、文档名称、字段等的表格。在字段列中,我显示了下拉列表,因此当我更改下拉列表中的值时,它应该在表中更新。我通过 jquery 将 DocumentId 和交叉字段 ID(行)传递给控制器。但是我在 Repository.cs 文件中收到此错误 Unknown Module 中发生了“System.StackOverflowException”类型的未处理异常。
这是我的控制器代码
public ActionResult FieldSubmitted(long VendorId, int DocumentId, int FieldId)
{
SubmittedDocument submittedDocument = new SubmittedDocument();
var requestedDocument = _requestedDocumentService.GetVendorDocuments(VendorId).Where(t => t.DocumentID == DocumentId).FirstOrDefault();
if (requestedDocument != null)
{
submittedDocument = _submittedDocumentService.GetVendorDocuments(VendorId).Where(t => t.RequestedDocumentID == requestedDocument.RequestedDocumentID).FirstOrDefault();
submittedDocument.FieldId = FieldId;
_submittedDocumentService.UpdateSubmittedDocument(submittedDocument);
}
return Json("", JsonRequestBehavior.AllowGet);
}
我的服务
public int UpdateSubmittedDocument(SubmittedDocument submittedDocument)
{
int a= _submittedDocumentRepository.Update(submittedDocument, submittedDocument.SubmittedDocumentID);
return a;
}
存储库.cs
public class Repository<TObject> : IRepository<TObject>
public virtual void UpdateAuditedEntries(object obj)
{
if (CurrentUser == null)
return;
if (obj == null)
return;
var auditedEntity = obj as IAuditedEntity;
if (auditedEntity != null)
{
auditedEntity.ModifiedBy = CurrentUser.UserId;
auditedEntity.ModifiedDateTime = DateTime.Now;
obj.GetType().GetProperties().ToList().ForEach(x =>
{
var child = x.GetValue(obj);
UpdateAuditedEntries(child);
});
}
else
{
var propertyCollection = obj as ICollection;
if (propertyCollection != null)
{
foreach (object child in propertyCollection)
{
UpdateAuditedEntries(child);
}
}
}
}
我在 var child = x.GetValue(obj); 处遇到错误 此行 Unknown Module 中发生了“System.StackOverflowException”类型的未处理异常。