Пример #1
0
        /// <summary>
        /// 返回实体集
        /// </summary>
        /// <returns></returns>
        public EntityContainer AsEntityContainer()
        {
            EntityContainer ec = new EntityContainer();
            ObjectCursor    oc = AsCursor();

            for (int i = 0; i < oc.Count; i++)
            {
                ec.Add((EntityObject)oc.NextObject());
            }
            return(ec);
        }
Пример #2
0
        /// <summary>
        /// tintown add at 2004-10-24
        /// 此方法主要方便于那些非主键查询,能及时获取唯一对象
        /// 如果查询中存在多个对象,系统则返回第一条记录
        /// </summary>
        /// <returns></returns>
        public EntityObject AsEntity()
        {
            EntityObject eo = null;
            ObjectCursor oc = AsCursor();

            if (oc.HasObject())
            {
                eo = (EntityObject)oc.NextObject();
            }

            return(eo);
        }