コード例 #1
0
        public bool IncluirOperacao(Operacao Entity)
        {
            bool returnIncluirOperacao = false;

            using (EderTesteContext context = new EderTesteContext())
            {
                context.Operacao.Add(Entity);
                context.SaveChanges();
                returnIncluirOperacao = true;
            }

            return(returnIncluirOperacao);
        }
コード例 #2
0
        public bool AtualizarOperacao(Operacao Entity)
        {
            bool returnAtualizarOperacao = false;

            using (EderTesteContext context = new EderTesteContext())
            {
                context.Operacao.Attach(Entity);
                context.Entry(Entity).State = EntityState.Modified;
                context.SaveChanges();
                returnAtualizarOperacao = true;
            }

            return(returnAtualizarOperacao);
        }