helpers

I which I could put this in the base class somehow, but we can simplify the code if the inherited class override the By and Where methods like so

        ///
        /// Get a single User By the property and value specified
        ///
        ///
        ///
        ///
        static public DBUser By(string property, object value)
        {
            return (DBUser)DBObject.By(property, value, typeof(DBUser), DBUser._conn);
        }

        ///
        /// Returns DBList where all the DBUsers have a matching property
        ///
        ///
        ///
        ///
        ///
        static public DBList Where(string property, string evaluator, object value)
        {
            return DBObject.Where(property, evaluator, value, typeof(DBUser), DBUser._conn);
        }

Then we can make simple calls like:

DBUser u3 = DBUser.By("firstname", "chris");
//and
DBList users1 = DBUser.Where("id", "<=", 1313);
  • Share/Bookmark

You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

CommentLuv Enabled