2013-07-31 5 views
0

되는 리플렉터 AuthorizedChangeSet 방법 찾고 어떻게 그것이 foreach 루프 객체로서의 캐스트 엔티티 객체의 속성에 액세스 할 수있다.NET 리플렉터 MSIL

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; 
    } 

로 표시 ???

답변

0

신중히 읽으십시오. 엔티티가 아닌 엔트리 멤버 만 액세스합니다. 또 다른 옵션은 ValidateMethodPermissions가 리플렉션을 사용하는 것일 수 있습니다.