From 723f451cbfc1c601e46c287cb24649f1022503db Mon Sep 17 00:00:00 2001 From: Litichevskiy Dmitriy Date: Wed, 7 Aug 2024 12:20:45 +0300 Subject: [PATCH] Dispose was simplified --- .../ServiceImplementations/ServiceImplementation.cs | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/Abstractions/ServiceImplementations/ServiceImplementation.cs b/src/Abstractions/ServiceImplementations/ServiceImplementation.cs index 626f8ab..4eed44a 100644 --- a/src/Abstractions/ServiceImplementations/ServiceImplementation.cs +++ b/src/Abstractions/ServiceImplementations/ServiceImplementation.cs @@ -18,19 +18,10 @@ public class ServiceImplementation : IDisposable /// public IServiceProvider ServiceProvider { get; set; } - protected virtual void Dispose(bool disposing) - { - if (disposing) - { - if(ServiceProvider is IDisposable disposable) - disposable.Dispose(); - } - } - public void Dispose() { - Dispose(true); - GC.SuppressFinalize(this); + if (ServiceProvider is IDisposable disposable) + disposable.Dispose(); } } } \ No newline at end of file