Skip to content

Commit 5ad869c

Browse files
committed
refactor StorageSettings to StorageAccountSettings
Related to: aliencube#319
1 parent 82b8ffd commit 5ad869c

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/AzureOpenAIProxy.ApiApp/Configurations/StorageSettings.cs src/AzureOpenAIProxy.ApiApp/Configurations/StorageAccountSettings.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ namespace AzureOpenAIProxy.ApiApp.Configurations;
33
/// <summary>
44
/// This represents the settings entity for Storage.
55
/// </summary>
6-
public class StorageSettings
6+
public class StorageAccountSettings
77
{
88
/// <summary>
99
/// Gets the name of the configuration settings.
1010
/// </summary>
11-
public const string Name = "Storage";
11+
public const string Name = "StorageAccount";
1212

1313
/// <summary>
1414
/// Gets or sets the <see cref="TableSettings"/> instance.

src/AzureOpenAIProxy.ApiApp/Extensions/StorageSettingsExtensions.cs

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@
44
namespace AzureOpenAIProxy.ApiApp.Extensions;
55

66
/// <summary>
7-
/// This represents the extension entity for the <see cref="StorageSettings"/> class.
7+
/// This represents the extension entity for the <see cref="StorageAccountSettings"/> class.
88
/// </summary>
99
public static class StorageSettingsExtensions
1010
{
1111
/// <summary>
1212
/// Gets the Storage configuration settings by reading appsettings.json.
1313
/// </summary>
1414
/// <param name="services"><see cref="IServiceCollection"/> instance.</param>
15-
/// <returns>Returns <see cref="StorageSettings"/> instance.</returns>
16-
public static StorageSettings GetStorageSettings(this IServiceCollection services)
15+
/// <returns>Returns <see cref="StorageAccountSettings"/> instance.</returns>
16+
public static StorageAccountSettings GetStorageSettings(this IServiceCollection services)
1717
{
1818
var configuration = services.BuildServiceProvider().GetService<IConfiguration>()
1919
?? throw new InvalidOperationException($"{nameof(IConfiguration)} service is not registered.");
2020

21-
var settings = configuration.GetSection(StorageSettings.Name).Get<StorageSettings>()
22-
?? throw new InvalidOperationException($"{nameof(StorageSettings)} could not be retrieved from the configuration.");
21+
var settings = configuration.GetSection(StorageAccountSettings.Name).Get<StorageAccountSettings>()
22+
?? throw new InvalidOperationException($"{nameof(StorageAccountSettings)} could not be retrieved from the configuration.");
2323

2424
return settings;
2525
}

src/AzureOpenAIProxy.ApiApp/Repositories/AdminEventRepository.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public interface IAdminEventRepository
4343
/// </summary>
4444
public class AdminEventRepository(IServiceCollection sc) : IAdminEventRepository
4545
{
46-
private readonly StorageSettings _storageSettings = sc.GetStorageSettings();
46+
private readonly StorageAccountSettings _storageSettings = sc.GetStorageSettings();
4747

4848
/// <inheritdoc />
4949
public async Task<AdminEventDetails> CreateEvent(AdminEventDetails eventDetails)

0 commit comments

Comments
 (0)