コード例 #1
0
        public async Task <int> InserirAsync(AcoesModeloBancoDeDados acao)
        {
            using (var context = _fabricaDeContextos.CriaContextoDe <EntregaContext>(TipoDeConexao.Entrega))
            {
                EntityEntry <AcoesModeloBancoDeDados> objetoInserido = await context.Acoes.AddAsync(acao);

                await context.SaveChangesAsync();

                return(objetoInserido.Entity.Id);
            }
        }
コード例 #2
0
        public async Task Deve_Inserir_Nova_Acao_No_Banco()
        {
            //Arrange
            IRepositorioDeAcoes     repositorio = TesteInfraService.ServiceProvider.GetService <IRepositorioDeAcoes>();
            AcoesModeloBancoDeDados acao        = new AcoesModeloBancoDeDados()
            {
                ProcedimentoId = 1
            };

            throw new NotImplementedException();
            //Act
            //int idInserido = await repositorio.InserirAsync(acao);
            //AcoesModeloBancoDeDados[] acaoObtida = await repositorio.ObterAsync(new int[] { idInserido });

            ////Assert
            //Assert.IsNotNull(acaoObtida[0]);
            //Assert.AreEqual(idInserido, acaoObtida[0].Id);
        }
コード例 #3
0
 public Task UpdateAsync(AcoesModeloBancoDeDados modelo)
 {
     throw new NotImplementedException();
 }