DAL层接口代码

/*
Name:IDataBase
Author: Terry Dong
Description: interface for data access
*/
using System;
using System.Data;
using System.Collections.Generic;
using TerryDong.SystemFramework;
namespace TerryDong.DAL
{
    public interface IDataBase<T>
    {

        /// <summary>
        /// get max ID
        /// </summary>
        int GetMaxId();

        /// <summary>
        /// if exists data
        /// </summary>
        bool Exists(string primaryKeyId);

        /// <summary>
        /// add new entity
        /// </summary>
        void Add(T t);

        /// <summary>
        /// update entity
        /// </summary>
        void Update(T t);

        /// <summary>
        /// delete data by primarykeyid
        /// </summary>
        void Delete(int primaryKeyId);

        /// <summary>
        /// get entity data
        /// </summary>
        T GetEntity(int primaryKeyId);

        /// <summary>
        /// get dataset data
        /// </summary>
        DataSet GetDataSet(string strWhere);

        /// <summary>
        /// get dataset data default is all.
        /// </summary>
        DataSet GetDataSet();

        /// <summary>
        /// get entity list by input condition
        /// </summary>
        SortList<T> GetList(string strWhere);

    }
}

你可能感兴趣的:(接口)