From 692d688dc31ff49b6e60d9e39464285eeedcb189 Mon Sep 17 00:00:00 2001 From: Oliver Booth Date: Sat, 12 Aug 2023 22:38:28 +0100 Subject: [PATCH] refactor: remove unused config service --- OliverBooth/Services/ConfigurationService.cs | 34 -------------------- 1 file changed, 34 deletions(-) delete mode 100644 OliverBooth/Services/ConfigurationService.cs diff --git a/OliverBooth/Services/ConfigurationService.cs b/OliverBooth/Services/ConfigurationService.cs deleted file mode 100644 index 5a7f777..0000000 --- a/OliverBooth/Services/ConfigurationService.cs +++ /dev/null @@ -1,34 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using OliverBooth.Data; - -namespace OliverBooth.Services; - -/// -/// Represents a service for retrieving configuration values. -/// -public sealed class ConfigurationService -{ - private readonly IDbContextFactory _webContextFactory; - - /// - /// Initializes a new instance of the class. - /// - /// - /// The for the . - /// - public ConfigurationService(IDbContextFactory webContextFactory) - { - _webContextFactory = webContextFactory; - } - - /// - /// Gets the value of a site configuration key. - /// - /// The key of the site configuration item. - /// The value of the site configuration item. - public string? GetSiteConfiguration(string key) - { - using WebContext context = _webContextFactory.CreateDbContext(); - return context.SiteConfiguration.Find(key)?.Value; - } -}