public IActionResult NewUser([FromBody] User user) { #region InsertingOnSqlServer _timeMeasurement.StartWatch(); _userOperation.InsertUser(user, DbType.SqlServer); _timeMeasurement.StopWatch(); TimeSpan spentTimeOnSqlServer = _timeMeasurement.PrintTimeSpent(); #endregion _timeMeasurement.ResetWatch(); #region InsertingOnMongoDB _timeMeasurement.StartWatch(); _userOperation.InsertUser(user, 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() })); }