private void AppendFilter(string columnName, object value, Comparison whereOperator, WhereAppender appender)
        {
            DaoSearchFilter toAdd = new DaoSearchFilter();

            toAdd.AddParameter(columnName, value, whereOperator);
            this.AppendFilter(toAdd, appender);
        }
Exemple #2
0
        public static DaoObjectCollection <DaoType> LoadAll <DaoType>(int pageSize, DatabaseAgent agent) where DaoType : DaoObject, new()
        {
            DaoSearchFilter filter = new DaoSearchFilter();
            DaoType         proxy  = new DaoType();

            filter.AddParameter(proxy.IdColumnName, null, Comparison.NotEqualTo);
            return(new DaoObjectCollection <DaoType>(filter, pageSize, agent));
        }
Exemple #3
0
        public DaoObjectCollection(DaoSearchFilter filter, int pageSize, DatabaseAgent agent)
            : base()
        {
            this.filter   = filter;
            this.PageSize = pageSize;
            this.pagedIds = new Book <long>(new List <long>(), pageSize);

            this.agent = agent;
            this.GetIds();
        }
Exemple #4
0
        public DaoObjectCollection(DaoSearchFilter filter)
            : base()
        {
            this.filter   = filter;
            this.pagedIds = new Book <long>(new List <long>(), DefaultPageSize);
            T proxy = new T();

            this.agent = DaoContext.Get(proxy.DataContextName).DatabaseAgent;
            this.GetIds();
        }
        public virtual void AppendFilter(DaoSearchFilter filter, WhereAppender appender)
        {
            if (filter == this)
            {
                throw new InvalidOperationException("DaoSearchFilter cannot be added to itself");
            }
            if (appender == WhereAppender.None)
            {
                throw new InvalidOperationException("appender cannot be WhereAppender.None");
            }

            searchParameters.Insert(0, new DaoOpenParen());
            searchParameters.Add(new DaoCloseParen());
            searchParameters.Add(new DaoWhereAppenderSearchToken(appender));
            filter.IncludeOutterParens = true;
            dbParameters.AddRange(filter.dbParameters);
            searchParameters.Add(filter);
        }