Beispiel #1
0
        public async Task <int> SalvarProduto(Produto produto)
        {
            await lojaBlueContext.AddAsync(produto);

            await lojaBlueContext.SaveChangesAsync();

            return(produto.Id);
        }
Beispiel #2
0
        public async Task <int> GravarPedido(Pedido pedido)
        {
            var pedidoSalvo = await lojaBlueContext.AddAsync(pedido);

            await lojaBlueContext.SaveChangesAsync();

            return(pedidoSalvo.Entity.Id);
        }
Beispiel #3
0
        public async Task <string> AdicionarCliente(ClienteDto cliente)
        {
            var clieteModel = new Cliente(cliente.Id, cliente.Nome, cliente.Telefone, cliente.Email);
            var clienteSavo = await lojaBlueContext.AddAsync(clieteModel);

            await lojaBlueContext.SaveChangesAsync();

            return(clienteSavo.Entity.Id);
        }