数据查询基础模板

    /// <summary>

    /// 数据查询业务逻辑基础类

    /// </summary>

    /// <typeparam name="T">条件类型</typeparam>

    /// <typeparam name="E">实体对象类型</typeparam>

    public abstract class QueryLogicAdapter<T,E> : SingleLogicAdapter where T:IFilter,new()

    {

        #region IQueryLogic 成员

        private T mFilter = new T();

        public T Filter

        {

            get

            {

                return mFilter;

            }

            set

            {

                mFilter = value;

            }

        }

        private List<E> mItems;

        public List<E> Items

        {

            get

            {

                return mItems;

            }

      

        }

        protected override void OnExecute()

        {

            mItems = Filter.GetExpression().List<E>();

        }

 

        #endregion

    }

应用例程:

    public class UserQuery:HFSoft.BusinessLogic.QueryLogicAdapter<UserFilter,Entities.SysUser>

    {

    }

 

posted on 2006-10-07 14:47  henry  阅读(1041)  评论(1编辑  收藏  举报

导航