public virtual void Dispose(bool disposing) { if (_disposed) { return; } if (disposing) { // free other managed objects that implement // IDisposable only try { if (Db.Database != null && Db.Database.Connection.State == ConnectionState.Open) { Db.Database.Connection.Close(); } } catch (ObjectDisposedException) { // do nothing, the objectContext has already been disposed } if (Db != null) { Db.Dispose(); Db = null; } } // release any unmanaged objects // set the object references to null _disposed = true; }
protected virtual void Dispose(bool disposing) { if (disposing) { if (_projetoModeloContext != null) { _projetoModeloContext.Dispose(); _projetoModeloContext = null; } } }
protected override void Seed(ProjetoModeloContext context) { // This method will be called after migrating to the latest version. // You can use the DbSet<T>.AddOrUpdate() helper extension method // to avoid creating duplicate seed data. E.g. // // context.People.AddOrUpdate( // p => p.FullName, // new Person { FullName = "Andrew Peters" }, // new Person { FullName = "Brice Lambson" }, // new Person { FullName = "Rowan Miller" } // ); // }
public bool AtualizarTodosTituloPendente(float valor, int fichaId, string planoNome) { try { using (var ctx = new ProjetoModeloContext()) { var query = "UPDATE Titulo SET Valor = '" + valor.ToString().Replace(",", ".") + "', PlanoNome = '" + planoNome + "' WHERE STATUS = 'P' AND FichaId ='" + fichaId + "' AND DataBaixa IS NULL "; ctx.Database.ExecuteSqlCommand(query); return(true); } } catch (Exception ex) { return(false); } }
public ClienteRepository(ProjetoModeloContext context) : base(context) { }
public RepositoryBase(ProjetoModeloContext projetoModeloContext) { this.projetoModeloContext = projetoModeloContext; }
public ProdutoPedidoRepository(ProjetoModeloContext projetoModeloContext) : base(projetoModeloContext) { }
public ProductRepository(ProjetoModeloContext dbContext) : base(dbContext) { _dbContext = dbContext; }
public UnitOfWork(ProjetoModeloContext projetoModeloContext) { _projetoModeloContext = projetoModeloContext; }
public RepositoryBase(ProjetoModeloContext dbContext) { _dbContext = dbContext; }
public ProdutoRepository(ProjetoModeloContext context) : base(context) { }
public ProductRepository(ProjetoModeloContext projetoModeloContext) : base(projetoModeloContext) { }
public EFCoreRepository(ProjetoModeloContext context) { _context = context; }
public ClientRepository(ProjetoModeloContext projetoModeloContext) : base(projetoModeloContext) { }