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));
     }
 }
예제 #2
0
        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();
        }
예제 #3
0
        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();
        }
예제 #4
0
        protected virtual void Dispose(bool disposing)
        {
            if (disposed)
            {
                return;
            }

            if (disposing)
            {
                Resources.Dispose();
            }

            disposed = true;
        }
 void OnDestroy()
 {
     m_resources.Dispose();
 }
예제 #6
0
 void OnDestroy()
 {
     m_resourcesManager.Dispose();
 }