public async Task <int> HuellaRegister(HuellaForRegister huellaRegister) { Huella huella = new Huella(); huella.Caslvl = huellaRegister.Caslvl; huella.CodigoHuella = huellaRegister.CodigoHuella; huella.ProductoId = huellaRegister.ProductoId; huella.FechaRegistro = DateTime.Now; using (var transaction = _context.Database.BeginTransaction()) { try { await _context.Huella.AddAsync(huella); await _context.SaveChangesAsync(); transaction.Commit(); } catch (System.Exception) { transaction.Rollback(); throw; } return(huella.Id); } }
public async Task <IActionResult> HuellaRegister(HuellaForRegister huellaForRegister) { var result = await _repoProducto.HuellaRegister(huellaForRegister); return(Ok(result)); }