From e56aaacc2ebe778845242bbafe95ed748415d176 Mon Sep 17 00:00:00 2001 From: Erik Hermansson Date: Mon, 29 Jan 2024 13:24:54 +0100 Subject: [PATCH] Added options setup action to ServiceCollection extension. --- Files.Api/Files.Api.csproj | 2 +- Files.Api/FilesServiceCollectionExtensions.cs | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Files.Api/Files.Api.csproj b/Files.Api/Files.Api.csproj index 8d8fa8f..289ddcb 100644 --- a/Files.Api/Files.Api.csproj +++ b/Files.Api/Files.Api.csproj @@ -5,7 +5,7 @@ enable enable True - 1.0.4 + 1.0.5 diff --git a/Files.Api/FilesServiceCollectionExtensions.cs b/Files.Api/FilesServiceCollectionExtensions.cs index f00ce04..dc4867c 100644 --- a/Files.Api/FilesServiceCollectionExtensions.cs +++ b/Files.Api/FilesServiceCollectionExtensions.cs @@ -6,8 +6,14 @@ namespace Microsoft.Extensions.DependencyInjection; public static class FilesServiceCollectionExtensions { public static IServiceCollection AddFiles( - this IServiceCollection services) + this IServiceCollection services, + Action? configureOptions = null) { + if (configureOptions != null) + { + services.Configure(configureOptions); + } + services.AddScoped(); services.AddSingleton();