通用 LINQ查询方法
public class BaseDAL<T> where T : class
{
public CiecClientDataContext db = new CiecClientDataContext();
#region MyRegion
public Table<T> GetTable()
{
return db.GetTable<T>();
}
public Table<T> GetAll()
{
return db.GetTable<T>();
}
public void Add(T t)
{
GetTable().InsertOnSubmit(t);
}
public void Delete(T t)
{
GetTable().DeleteOnSubmit(t);
}
public void Submitchanges()
{
db.SubmitChanges();
}
#endregion