Add project files.
This commit is contained in:
parent
70496cc367
commit
f5447ca448
25
Module.sln
Normal file
25
Module.sln
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio Version 16
|
||||||
|
VisualStudioVersion = 16.0.30907.101
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PoweredSoft.Module.Abstractions", "PoweredSoft.Module.Abstractions\PoweredSoft.Module.Abstractions.csproj", "{B88DB8C9-EDAA-4B52-951C-5FA4BBEE18BF}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{B88DB8C9-EDAA-4B52-951C-5FA4BBEE18BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{B88DB8C9-EDAA-4B52-951C-5FA4BBEE18BF}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{B88DB8C9-EDAA-4B52-951C-5FA4BBEE18BF}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{B88DB8C9-EDAA-4B52-951C-5FA4BBEE18BF}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
SolutionGuid = {4BCE340F-4C9B-4495-AE0B-AFE55C8D6191}
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
10
PoweredSoft.Module.Abstractions/IModule.cs
Normal file
10
PoweredSoft.Module.Abstractions/IModule.cs
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace PoweredSoft.Module.Abstractions
|
||||||
|
{
|
||||||
|
public interface IModule
|
||||||
|
{
|
||||||
|
IServiceCollection ConfigureServices(IServiceCollection services);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,11 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>netstandard2.0</TargetFramework>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="2.0.0" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
@ -0,0 +1,14 @@
|
|||||||
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
|
||||||
|
namespace PoweredSoft.Module.Abstractions
|
||||||
|
{
|
||||||
|
public static class ServiceCollectionExtensions
|
||||||
|
{
|
||||||
|
public static IServiceCollection AddModule<T>(IServiceCollection services)
|
||||||
|
where T : IModule, new()
|
||||||
|
{
|
||||||
|
var module = new T();
|
||||||
|
return module.ConfigureServices(services);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user