public async Task <bool> Update(ZenbidSale sale)
        {
            var updateResult = await _context
                               .Sales
                               .ReplaceOneAsync(filter : g => g.Id == sale.Id, replacement : sale);

            return(updateResult.IsAcknowledged &&
                   updateResult.ModifiedCount > 0);
        }
Exemplo n.º 2
0
 public async Task <IActionResult> UpdateZenbidSale([FromBody] ZenbidSale sale)
 {
     return(Ok(await _repository.Update(sale)));
 }
 public async Task Create(ZenbidSale sale)
 {
     await _context.Sales.InsertOneAsync(sale);
 }
Exemplo n.º 4
0
        public async Task <ActionResult <IEnumerable <ZenbidSale> > > CreateZenbidSale([FromBody] ZenbidSale sale)
        {
            await _repository.Create(sale);

            return(CreatedAtRoute("GetSales", new { id = sale }, sale));
        }