コード例 #1
0
        public async Task <ActionResult> completarRegistroMedico([FromBody] RegistroMedicoDiagnosticoDTO model)
        {
            string txt = "completa registro medico by user => " + getUser();

            using (var transaction = context.Database.BeginTransaction())
            {
                logger.LogInformation("BeginTransaction {0} ", txt);
                try
                {
                    var cp = await fundabiem.completRegistroMedico(model);

                    transaction.Commit();
                    logger.LogInformation("Commit transaction");
                    return(Ok(cp));
                }
                catch (Exception ex)
                {
                    transaction.Rollback();
                    logger.LogError("RoolBAck transaction {0} ", txt);
                    logger.LogError(ex.ToString());
                    return(BadRequest("No se completo la operacion de completar registro medico"));
                }
            }
        }