Example #1
0
        public void Retrieve(IStorageObject obj, IDataReader reader)
        {
            this.Read(obj, reader);
            DbEventArgs e = new DbEventArgs(this, DbOperationAction.Select);

            obj.OnRead(this, e);
        }
Example #2
0
        public bool Retrieve(IStorageObject obj, string keyName, object keyValue)
        {
            bool   flag = false;
            string sql  = this.SqlFormatter.GetSelectSQL(obj.GetType(), keyName, keyValue);

            Debug.WriteLine("SelectSQL: " + sql);
            using (IDataReader reader = this.DbOperator.Query(sql))
            {
                if (reader.Read())
                {
                    this.Read(obj, reader);
                    DbEventArgs e = new DbEventArgs(this, DbOperationAction.Select);
                    obj.OnRead(this, e);
                    flag = true;
                }
            }
            return(flag);
        }