You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- using System;
- using Permission.Entity.DbContext;
- using Permission.Infrastructure.Core;
-
- namespace Permission.Data
- {
- public class BaseUnitOfWork : IBaseUnitOfWork, IDisposable
- {
- #region 数据上下文
-
- /// <summary>
- /// 数据上下文
- /// </summary>
- private PermissionContext _context;
-
- public BaseUnitOfWork(PermissionContext context)
- {
- _context = context;
- }
-
- #endregion
-
- public bool Commit()
- {
- return _context.SaveChanges() > 0;
- }
-
- public void Dispose()
- {
- if (_context != null)
- {
- _context.Dispose();
- }
- GC.SuppressFinalize(this);
- }
- }
- }
|