Beispiel #1
0
        private PrincipalSearchResult <Principal> FindAll(bool returnOne)
        {
            int num;

            if (this.qbeFilter != null)
            {
                if (this.qbeFilter.unpersisted)
                {
                    if (!this.HasReferentialPropertiesSet())
                    {
                        StoreCtx          queryCtx          = this.ctx.QueryCtx;
                        PrincipalSearcher principalSearcher = this;
                        if (returnOne)
                        {
                            num = 1;
                        }
                        else
                        {
                            num = -1;
                        }
                        ResultSet resultSet = queryCtx.Query(principalSearcher, num);
                        PrincipalSearchResult <Principal> principals = new PrincipalSearchResult <Principal>(resultSet);
                        return(principals);
                    }
                    else
                    {
                        throw new InvalidOperationException(StringResources.PrincipalSearcherNonReferentialProps);
                    }
                }
                else
                {
                    throw new InvalidOperationException(StringResources.PrincipalSearcherPersistedPrincipal);
                }
            }
            else
            {
                throw new InvalidOperationException(StringResources.PrincipalSearcherMustSetFilter);
            }
        }