62,072
社区成员
发帖
与我相关
我的任务
分享
public static class BaseRepository<T> where T : class
{
public static IEnumerable<T> GetList(string sql)
{
IEnumerable<T> query = null;
using (Entities db = new Entities())
{
query = db.Database.SqlQuery<T>(sql); //db.Set<T>().SqlQuery(sql);
return query;
}
}、
}