diff --git a/ApiPolo/Controllers/PoloController.cs b/ApiPolo/Controllers/PoloController.cs index 42f3c52..ea89669 100644 --- a/ApiPolo/Controllers/PoloController.cs +++ b/ApiPolo/Controllers/PoloController.cs @@ -5647,15 +5647,15 @@ namespace ApiPolo.Controllers newSerial = await getSeriale(token); Rapp_New r = await fillRappNewByInput(model, token, newSerial, _confLette); - //DbContext dbContext = (DbContext)_dbContextFactory.GetDbContext(ten); + Maras_DbContext dbContext = (Maras_DbContext)_dbContextFactory.GetDbContext("MARAS"); - //using (var transaction = dbContext.Database.BeginTransaction()) - //{ - // await dbContext.Rapps.AddAsync(r); - // await dbContext.SaveChangesAsync(); - // transaction.Commit(); - //} + using (var transaction = dbContext.Database.BeginTransaction()) + { + await dbContext.Rapps.AddAsync(r); + await dbContext.SaveChangesAsync(); + transaction.Commit(); + } //scrittura test @@ -6588,6 +6588,30 @@ namespace ApiPolo.Controllers //return calltec_out; } + + [HttpPost] + [Route("chiamate/test")] + public async Task> test([FromBody] Rapp_New model) + { + Maras_DbContext dbContext = (Maras_DbContext)_dbContextFactory.GetDbContext("MARAS"); + string mex = string.Empty; + try + { + using (var transaction = dbContext.Database.BeginTransaction()) + { + await dbContext.Rapps.AddAsync(model); + await dbContext.SaveChangesAsync(); + transaction.Commit(); + } + } + catch(Exception ex) + { + mex = ex.Message; + } + + return StatusCode(StatusCodes.Status200OK, mex); + } + #endregion #region MANUTENZIONI