DBLogController.cs:
#region 全局变量及构造器
IDBLogRepository dblog;
public DBLogController(): this(new DBLogRepository())
{
}
public DBLogController(DBLogRepository dblog)
{
this.dblog = dblog;
}
#endregion
DBLogRepository.cs:
public class DBLogRepository : IDBLogRepository
{
DBLogDataContext dblog;
public DBLogRepository()
{
dblog = new DBLogDataContext();
}