-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move the new AddResourceConfiguration to the Abstractions project (#1…
- Loading branch information
1 parent
b7ee089
commit 69762e2
Showing
5 changed files
with
20 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/OrchardCore/OrchardCore.ResourceManagement.Abstractions/ServiceCollectionExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters