0

リフレクターが示す 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 ループでエンティティ オブジェクトのプロパティにアクセスするにはどうすればよいでしょうか?

4

1 に答える 1

0

注意深く読んでください、そうではありません。エントリのメンバーのみにアクセスし、エンティティにはアクセスしません。もう 1 つのオプションは、ValidateMethodPermissions がリフレクションを使用することです。

于 2014-02-20T20:49:42.927 に答える