Add project files.

This commit is contained in:
David Lebee 2021-08-11 15:23:58 -04:00
parent 70496cc367
commit f5447ca448
4 changed files with 60 additions and 0 deletions

25
Module.sln Normal file
View 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

View File

@ -0,0 +1,10 @@
using Microsoft.Extensions.DependencyInjection;
using System;
namespace PoweredSoft.Module.Abstractions
{
public interface IModule
{
IServiceCollection ConfigureServices(IServiceCollection services);
}
}

View File

@ -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>

View File

@ -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);
}
}
}