Skip to content

Commit

Permalink
Move the new AddResourceConfiguration to the Abstractions project (#1…
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeAlhayek authored Dec 3, 2024
1 parent b7ee089 commit 69762e2
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<ItemGroup>
<ProjectReference Include="..\..\OrchardCore\OrchardCore.DisplayManagement.Liquid\OrchardCore.DisplayManagement.Liquid.csproj" />
<ProjectReference Include="..\..\OrchardCore\OrchardCore.Module.Targets\OrchardCore.Module.Targets.csproj" />
<ProjectReference Include="..\..\OrchardCore\OrchardCore.ResourceManagement\OrchardCore.ResourceManagement.csproj" />
<ProjectReference Include="..\..\OrchardCore\OrchardCore.ResourceManagement.Core\OrchardCore.ResourceManagement.Core.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\OrchardCore\OrchardCore.ResourceManagement.Abstractions\OrchardCore.ResourceManagement.Abstractions.csproj" />
<ProjectReference Include="..\..\OrchardCore\OrchardCore.Theme.Targets\OrchardCore.Theme.Targets.csproj" />
<ProjectReference Include="..\..\OrchardCore\OrchardCore.DisplayManagement\OrchardCore.DisplayManagement.csproj" />
<ProjectReference Include="..\..\OrchardCore\OrchardCore.ResourceManagement\OrchardCore.ResourceManagement.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\OrchardCore\OrchardCore.ResourceManagement.Abstractions\OrchardCore.ResourceManagement.Abstractions.csproj" />
<ProjectReference Include="..\..\OrchardCore\OrchardCore.Theme.Targets\OrchardCore.Theme.Targets.csproj" />
<ProjectReference Include="..\..\OrchardCore\OrchardCore.DisplayManagement\OrchardCore.DisplayManagement.csproj" />
<ProjectReference Include="..\..\OrchardCore\OrchardCore.ResourceManagement\OrchardCore.ResourceManagement.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using Microsoft.Extensions.Options;
using OrchardCore.ResourceManagement;

namespace Microsoft.Extensions.DependencyInjection;

public static class ServiceCollectionExtensions
{
/// <summary>
/// Adds a service implementing <see cref="IConfigureOptions{ResourceManagementOptions}"/> to the service collection.
/// </summary>
/// <typeparam name="T">
/// The type of the implementation of <see cref="IConfigureOptions{ResourceManagementOptions}"/> to register.
/// </typeparam>
public static IServiceCollection AddResourceConfiguration<T>(this IServiceCollection services)
where T : class, IConfigureOptions<ResourceManagementOptions>
=> services.AddTransient<IConfigureOptions<ResourceManagementOptions>, T>();
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Options;
using OrchardCore.ResourceManagement;

namespace Microsoft.Extensions.DependencyInjection;
Expand All @@ -15,14 +14,4 @@ public static IServiceCollection AddResourceManagement(this IServiceCollection s

return services;
}

/// <summary>
/// Adds a service implementing <see cref="IConfigureOptions{ResourceManagementOptions}"/> to the service collection.
/// </summary>
/// <typeparam name="T">
/// The type of the implementation of <see cref="IConfigureOptions{ResourceManagementOptions}"/> to register.
/// </typeparam>
public static IServiceCollection AddResourceConfiguration<T>(this IServiceCollection services)
where T : class, IConfigureOptions<ResourceManagementOptions>
=> services.AddTransient<IConfigureOptions<ResourceManagementOptions>, T>();
}

0 comments on commit 69762e2

Please sign in to comment.