Silverlight 4.0 .NET反射镜MSIL
查看reflector显示为的AuthorizedChangeSet方法Silverlight 4.0 .NET反射镜MSIL,silverlight-4.0,ria,reflector,Silverlight 4.0,Ria,Reflector,查看reflector显示为的AuthorizedChangeSet方法 protected virtual bool AuthorizeChangeSet() { foreach (ChangeSetEntry entry in this.ChangeSet.ChangeSetEntries) { object entity = entry.Entity; if (entry.DomainOperation
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;
}
受保护的虚拟bool authorized变更集()
{
foreach(此.ChangeSet.ChangeSetEntries中的ChangeSetEntry条目)
{
对象实体=entry.entity;
if(entry.DomainOperationEntry!=null)
{
此.ValidateMethodPermissions(entry.DomainOperationEntry,entity);
}
if((entry.EntityActions!=null)和&entry.EntityActions.Any()
{
KeyValuePair=entry.EntityActions.Single();
DomainOperationEntry customMethod=this.ServiceDescription.GetCustomMethod(entity.GetType(),pair.Key);
这个.ValidateMethodPermissions(customMethod,entity);
}
}
return!this.ChangeSet.HasError;
}
当实体对象的强制转换为对象时,如何能够访问foreach循环中实体对象的属性???仔细阅读,它没有。它只访问条目的成员,而不访问实体的成员。 另一个选项是ValidateMethodPermission使用反射