diff --git a/src/RecurrentTasks/RecurrentTasks.csproj b/src/RecurrentTasks/RecurrentTasks.csproj index 038c898..73d068c 100644 --- a/src/RecurrentTasks/RecurrentTasks.csproj +++ b/src/RecurrentTasks/RecurrentTasks.csproj @@ -1,21 +1,22 @@  - Dmitry Popov, 2016-2018 + Dmitry Popov, 2016-2019 RecurrentTasks netstandard2.0 RecurrentTasks RecurrentTasks task;job;recurrent;recurring;aspnetcore - https://github.com/justdmitry/RecurrentTasks/releases/tag/v6.0.0 + https://github.com/justdmitry/RecurrentTasks/releases/tag/v6.1.0 https://github.com/justdmitry/RecurrentTasks - https://github.com/justdmitry/RecurrentTasks/blob/master/LICENSE + git https://github.com/justdmitry/RecurrentTasks.git - 6.0.2 + 6.1.0 RecurrentTasks for .NET allows you to run simple recurrent background tasks with specific intervals, without complex frameworks, persistance, etc... just_dmitry true + MIT diff --git a/src/RecurrentTasks/RecurrentTasksServiceCollectionExtensions.cs b/src/RecurrentTasks/RecurrentTasksServiceCollectionExtensions.cs index a9264b7..27d363d 100644 --- a/src/RecurrentTasks/RecurrentTasksServiceCollectionExtensions.cs +++ b/src/RecurrentTasks/RecurrentTasksServiceCollectionExtensions.cs @@ -20,8 +20,8 @@ public static IServiceCollection AddTask( var runnableType = typeof(TRunnable); - // Register TRunnable in DI container, if not registered already - if (!services.Any(x => x.ServiceType == runnableType)) + // Register TRunnable (if not an interface or abstract class) in DI container, if not registered already + if (!runnableType.IsAbstract && !services.Any(x => x.ServiceType == runnableType)) { services.Add(new ServiceDescriptor(runnableType, runnableType, runnableLifetime)); }