Skip to content

Commit

Permalink
TRunnable may be an interface
Browse files Browse the repository at this point in the history
  • Loading branch information
justdmitry committed Aug 12, 2019
1 parent 912839b commit 81b1c46
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions src/RecurrentTasks/RecurrentTasks.csproj
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Copyright>Dmitry Popov, 2016-2018</Copyright>
<Copyright>Dmitry Popov, 2016-2019</Copyright>
<AssemblyTitle>RecurrentTasks</AssemblyTitle>
<TargetFramework>netstandard2.0</TargetFramework>
<AssemblyName>RecurrentTasks</AssemblyName>
<PackageId>RecurrentTasks</PackageId>
<PackageTags>task;job;recurrent;recurring;aspnetcore</PackageTags>
<PackageReleaseNotes>https://github.com/justdmitry/RecurrentTasks/releases/tag/v6.0.0</PackageReleaseNotes>
<PackageReleaseNotes>https://github.com/justdmitry/RecurrentTasks/releases/tag/v6.1.0</PackageReleaseNotes>
<PackageProjectUrl>https://github.com/justdmitry/RecurrentTasks</PackageProjectUrl>
<PackageLicenseUrl>https://github.com/justdmitry/RecurrentTasks/blob/master/LICENSE</PackageLicenseUrl>
<PackageLicenseUrl></PackageLicenseUrl>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/justdmitry/RecurrentTasks.git</RepositoryUrl>
<Version>6.0.2</Version>
<Version>6.1.0</Version>
<Description>RecurrentTasks for .NET allows you to run simple recurrent background tasks with specific intervals, without complex frameworks, persistance, etc...</Description>
<Authors>just_dmitry</Authors>
<Company />
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Debug'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ public static IServiceCollection AddTask<TRunnable>(

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));
}
Expand Down

0 comments on commit 81b1c46

Please sign in to comment.