8,497
社区成员
发帖
与我相关
我的任务
分享
public interface IRepository<T> where T : Entity
{
T Load(int Id);
IList<T> Load();
void Save(T entity);
void Delete(T entity);
}
public class SqlToLinqRepository<T> : IRepository<T> where T : Entity
{
public static DataBaseDataContext context;
public static DataBaseDataContext Context
{
get
{
if (context == null)
return context = new DataBaseDataContext();
return context;
}
}
#region IRepository<T> 成员
public T Load(int Id)
{
return null;
}
public IList<T> Load()
{
throw new NotImplementedException();
}
public void Save(T entity)
{
throw new NotImplementedException();
}
public void Delete(T entity)
{
throw new NotImplementedException();
}
#endregion
}