Exemplo n.º 1
0
        public IActionResult PreviousUser([FromRoute] string id)
        {
            #region DeletingOnSqlServer
            _timeMeasurement.StartWatch();

            _userOperation.DeleteUser(id, DbType.SqlServer);

            _timeMeasurement.StopWatch();

            TimeSpan spentTimeOnSqlServer = _timeMeasurement.PrintTimeSpent();
            #endregion

            _timeMeasurement.ResetWatch();

            #region DeletingOnMongoDB
            _timeMeasurement.StartWatch();

            _userOperation.DeleteUser(id, DbType.MongoDB);

            _timeMeasurement.StopWatch();

            TimeSpan spentTimeOnMongoDB = _timeMeasurement.PrintTimeSpent();
            #endregion

            return(Json(new { elapsed_Time_On_SQL_Server = spentTimeOnSqlServer.ToString(), elapsed_Time_On_MongoDB = spentTimeOnMongoDB.ToString() }));
        }