41 lines
927 B
C#
41 lines
927 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data.Entity;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Weee.DAL
|
|
{
|
|
|
|
//public interface IUnitOfWork:IDisposable
|
|
//{
|
|
// DbSet<T> Set<T>() where T : class;
|
|
// void Commit();
|
|
//}
|
|
|
|
//public class UnitOfWork : IUnitOfWork
|
|
//{
|
|
// readonly WeeeDataContext _context;
|
|
// private bool _isDisposed;
|
|
// public UnitOfWork(WeeeDataContext context)
|
|
// {
|
|
// _context = context;
|
|
// }
|
|
// public DbSet<T> Set<T>() where T : class
|
|
// {
|
|
// return _context.Set<T>();
|
|
// }
|
|
// public void Commit()
|
|
// {
|
|
// _context.SaveChanges();
|
|
// }
|
|
// public void Dispose()
|
|
// {
|
|
// if (_isDisposed) return;
|
|
// _isDisposed = true;
|
|
// _context.Dispose();
|
|
// }
|
|
//}
|
|
}
|