Skip to content

Commit

Permalink
Added the IModuleContainer as an object accessor to the service colle…
Browse files Browse the repository at this point in the history
…ction. (#58)
  • Loading branch information
mgernand authored Apr 26, 2024
1 parent d73b663 commit 2f48f1d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions samples/MauiApp1/MauiApp1.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@
<PackageReference Include="CommunityToolkit.Maui.Markup" Version="4.0.0" />
<PackageReference Include="CommunityToolkit.Maui.MediaElement" Version="3.1.0" />
<PackageReference Include="JetBrains.Annotations" Version="2023.3.0" />
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.20" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.20" />
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.21" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.21" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
</ItemGroup>

Expand Down
4 changes: 2 additions & 2 deletions samples/Samples.sln
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Fluxera.Extensions.Hosting.
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorApp1", "BlazorApp1\BlazorApp1.csproj", "{ADC37B0F-E535-4CED-A434-774C26CC76C1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorApp2", "BlazorApp2\BlazorApp2\BlazorApp2.csproj", "{62802EF0-456D-4172-B234-238B796B0790}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorApp2", "BlazorApp2\BlazorApp2\BlazorApp2.csproj", "{62802EF0-456D-4172-B234-238B796B0790}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorApp2.Client", "BlazorApp2\BlazorApp2.Client\BlazorApp2.Client.csproj", "{5C424875-056E-4662-997E-D55EE61D2D12}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorApp2.Client", "BlazorApp2\BlazorApp2.Client\BlazorApp2.Client.csproj", "{5C424875-056E-4662-997E-D55EE61D2D12}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "BlazorApp2", "BlazorApp2", "{71808A6D-BEC7-47BF-B01F-E9778EC6E6D4}"
EndProject
Expand Down
2 changes: 1 addition & 1 deletion samples/TestProject1/TestProject1.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="NUnit" Version="4.1.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="NUnit.Analyzers" Version="4.1.0">
<PackageReference Include="NUnit.Analyzers" Version="4.2.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public interface IModuleLoader
{
/// <summary>
/// Loads all modules starting with the given startup module and
/// then loading it's dependencies.
/// then loading its dependencies.
/// </summary>
/// <param name="startupModuleType"></param>
/// <param name="services"></param>
Expand Down
3 changes: 3 additions & 0 deletions src/Fluxera.Extensions.Hosting/ApplicationLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,14 @@ public ApplicationLoader(
this.PluginSources = pluginSources;
this.Modules = modules;

// Configure the module container.
services.AddSingleton<IModuleContainer>(this);
services.AddObjectAccessor<IModuleContainer>(this, ObjectAccessorLifetime.ConfigureServices);

// Configure the services of the modules.
modules.ConfigureServices(services);

// Configure the application loader.
services.AddSingleton<IApplicationLoader>(this);
}

Expand Down

0 comments on commit 2f48f1d

Please sign in to comment.