public static long Count(WhereDelegate <DaoReferenceObjectWithForeignKeyColumns> where, Database db = null)
        {
            DaoReferenceObjectWithForeignKeyColumns c = new DaoReferenceObjectWithForeignKeyColumns();
            IQueryFilter filter = where (c);
            QuerySet     query  = new QuerySet();

            query.Count <DaoReferenceObjectWithForeignKey>();
            query.Where(filter);

            if (db == null)
            {
                db = Db.For <DaoReferenceObjectWithForeignKey>();
            }
            query.Execute(db);
            return(query.Results.As <CountResult>(0).Value);
        }
        public static DaoReferenceObjectWithForeignKeyCollection Top(int count, WhereDelegate <DaoReferenceObjectWithForeignKeyColumns> where, Database db = null)
        {
            DaoReferenceObjectWithForeignKeyColumns c = new DaoReferenceObjectWithForeignKeyColumns();
            IQueryFilter filter = where (c);
            QuerySet     query  = new QuerySet();

            query.Top <DaoReferenceObjectWithForeignKey>(count);
            query.Where(filter);

            if (db == null)
            {
                db = Db.For <DaoReferenceObjectWithForeignKey>();
            }

            query.Execute(db);
            return(query.Results.As <DaoReferenceObjectWithForeignKeyCollection>(0));
        }
        public override IQueryFilter GetUniqueFilter()
        {
            var colFilter = new DaoReferenceObjectWithForeignKeyColumns();

            return(colFilter.Id == IdValue);
        }