public async Task <int> InserirAsync(ProcedimentoBD procedimento)
        {
            using (var context = _fabricaDeContextos.CriaContextoDe <EntregaContext>(TipoDeConexao.Entrega))
            {
                EntityEntry <ProcedimentoBD> objetoInserido = await context.AddAsync(procedimento);

                await context.SaveChangesAsync();

                return(objetoInserido.Entity.Id);
            }
        }
Example #2
0
        public async Task Deve_Inserir_Novo_Procedimento_No_Banco()
        {
            //Arrange
            IRepositorioDeProcedimentos repositorio = TesteInfraService.ServiceProvider.GetService <IRepositorioDeProcedimentos>();
            ProcedimentoBD procedimento             = new ProcedimentoBD();

            throw new NotImplementedException();
            ////Act
            //int idInserido = await repositorio.InserirAsync(procedimento);
            //ProcedimentoModeloBancoDeDados[] procedimentoObtido = await repositorio.ObterAsync(new int[] { idInserido });

            ////Arrange
            //Assert.IsNotNull(procedimentoObtido[0]);
            //Assert.AreEqual(idInserido, procedimentoObtido[0].Id);
        }
 public Task UpdateAsync(ProcedimentoBD modelo)
 {
     throw new NotImplementedException();
 }