查看反射器显示为
的AuthorizedChangeSet方法protected virtual bool AuthorizeChangeSet()
{
foreach (ChangeSetEntry entry in this.ChangeSet.ChangeSetEntries)
{
object entity = entry.Entity;
if (entry.DomainOperationEntry != null)
{
this.ValidateMethodPermissions(entry.DomainOperationEntry, entity);
}
if ((entry.EntityActions != null) && entry.EntityActions.Any<KeyValuePair<string, object[]>>())
{
KeyValuePair<string, object[]> pair = entry.EntityActions.Single<KeyValuePair<string, object[]>>();
DomainOperationEntry customMethod = this.ServiceDescription.GetCustomMethod(entity.GetType(), pair.Key);
this.ValidateMethodPermissions(customMethod, entity);
}
}
return !this.ChangeSet.HasError;
}
当它作为对象???
转换时,如何在foreach循环中访问实体对象的属性答案 0 :(得分:0)
仔细阅读,但事实并非如此。它只访问条目成员而不是实体。 另一种选择可能是ValidateMethodPermissions使用反射