diff --git a/Module.sln b/Module.sln new file mode 100644 index 0000000..4036ec2 --- /dev/null +++ b/Module.sln @@ -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 diff --git a/PoweredSoft.Module.Abstractions/IModule.cs b/PoweredSoft.Module.Abstractions/IModule.cs new file mode 100644 index 0000000..5193b18 --- /dev/null +++ b/PoweredSoft.Module.Abstractions/IModule.cs @@ -0,0 +1,10 @@ +using Microsoft.Extensions.DependencyInjection; +using System; + +namespace PoweredSoft.Module.Abstractions +{ + public interface IModule + { + IServiceCollection ConfigureServices(IServiceCollection services); + } +} diff --git a/PoweredSoft.Module.Abstractions/PoweredSoft.Module.Abstractions.csproj b/PoweredSoft.Module.Abstractions/PoweredSoft.Module.Abstractions.csproj new file mode 100644 index 0000000..035083a --- /dev/null +++ b/PoweredSoft.Module.Abstractions/PoweredSoft.Module.Abstractions.csproj @@ -0,0 +1,11 @@ + + + + netstandard2.0 + + + + + + + diff --git a/PoweredSoft.Module.Abstractions/ServiceCollectionExtensions.cs b/PoweredSoft.Module.Abstractions/ServiceCollectionExtensions.cs new file mode 100644 index 0000000..0814fbb --- /dev/null +++ b/PoweredSoft.Module.Abstractions/ServiceCollectionExtensions.cs @@ -0,0 +1,14 @@ +using Microsoft.Extensions.DependencyInjection; + +namespace PoweredSoft.Module.Abstractions +{ + public static class ServiceCollectionExtensions + { + public static IServiceCollection AddModule(IServiceCollection services) + where T : IModule, new() + { + var module = new T(); + return module.ConfigureServices(services); + } + } +}