public Repository(UowContext context)
 {
     _context = context;
     _entity  = _context.Set <T>();
     // desabilita globalmente mecanismo de rastreamento do entity framework que trava (tracking) recurso enquanto está em uso
     //  _context.ChangeTracker.QueryTrackingBehavior = QueryTrackingBehavior.NoTracking;
 }
示例#2
0
 public void RemoveUoWConnection(UowContext uowContext)
 {
     try
     {
         bool isRemoved = _dbConnections.TryRemove(uowContext.contextId, out IDbConnection connection);
         if (isRemoved)
         {
             connection.Close();
         }
     }
     catch (Exception ex)
     {
         throw ex;
         // _logger.Error("Error in removing DB connection from ConnectionFactory", ex);
     }
 }
 public EFAccountRepository(UowContext context) : base(context)
 {
 }
示例#4
0
 public IDbConnection GetUoWConnection(UowContext uowContext)
 {
     return(_dbConnections.GetOrAdd(uowContext.contextId, (key) => CreateConnection()));
 }
示例#5
0
 public Uow(UowContext context)
 {
     _context   = context;
     AccountDal = new EFAccountRepository(_context);
 }
 public ProdutoRepository(UowContext context) : base(context)
 {
 }
 public EFGenericRepository(UowContext context)
 {
     _context = context;
 }
示例#8
0
 public UnitOfWork(UowContext context)
 {
     _context = context;
 }
示例#9
0
 public CategoriaProdutoRepository(UowContext context) : base(context)
 {
 }