using Microsoft.EntityFrameworkCore; using OliverBooth.Common.Data.Web; using OliverBooth.Common.Services; using OliverBooth.Data.Web; namespace OliverBooth.Services; /// internal sealed class ContactService : IContactService { private readonly IDbContextFactory _dbContextFactory; /// /// Initializes a new instance of the class. /// /// The . public ContactService(IDbContextFactory dbContextFactory) { _dbContextFactory = dbContextFactory; } /// public IReadOnlyCollection GetBlacklist() { using WebContext context = _dbContextFactory.CreateDbContext(); return context.ContactBlacklist.OrderBy(b => b.EmailAddress).ToArray(); } }