test
This commit is contained in:
parent
61863687e3
commit
c8489d34dd
@ -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<ActionResult<Chiamate_out>> 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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user