public IActionResult GetAll() { try { _logger.LogInformation("Request Lessons/GetAll"); return(Ok(resourceManager.GetAll())); } catch (Exception ex) { _logger.LogError("Error during Resource/GetAll", ex.Message); resourceManager.Dispose(); return(StatusCode(500, ex.Message)); } }
public void DisposeDoesNotDoAnythingWhenInstrumentationDisabled() { DisableInstrumentation(); var counter1 = Substitute.For <IPerformanceCounter>(); var counter2 = Substitute.For <IPerformanceCounter>(); var resourcesManager = new ResourcesManager(new[] { counter1, counter2 }, _configurationReader); resourcesManager.Dispose(); counter1.DidNotReceive().Stop(); counter2.DidNotReceive().Stop(); }
public void DisposeStopsAllThePerformanceCounters() { EnableInstrumentation(); var counter1 = Substitute.For <IPerformanceCounter>(); var counter2 = Substitute.For <IPerformanceCounter>(); var resourcesManager = new ResourcesManager(new[] { counter1, counter2 }, _configurationReader); resourcesManager.Dispose(); counter1.Received().Stop(); counter2.Received().Stop(); }
protected virtual void Dispose(bool disposing) { if (disposed) { return; } if (disposing) { Resources.Dispose(); } disposed = true; }
void OnDestroy() { m_resources.Dispose(); }
void OnDestroy() { m_resourcesManager.Dispose(); }