using Microsoft.EntityFrameworkCore;
using OliverBooth.Common.Data.Web;
using OliverBooth.Common.Data.Web.Contact;
namespace OliverBooth.Common.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();
}
}