29 lines
1 KiB
C#
29 lines
1 KiB
C#
|
using Dapper;
|
||
|
using Galaeth.Core.Entities;
|
||
|
using Galaeth.Core.Infrastructure;
|
||
|
using Galaeth.Core.RepositoryInterfaces;
|
||
|
using Injectio.Attributes;
|
||
|
|
||
|
namespace Galaeth.DAL.Repositories;
|
||
|
|
||
|
/// <inheritdoc cref="Galaeth.Core.RepositoryInterfaces.IEmailDomainBlacklistRepository" />
|
||
|
[RegisterScoped]
|
||
|
public class EmailDomainBlacklistRepository : BaseRepository<EmailDomainBlacklist, string>, IEmailDomainBlacklistRepository
|
||
|
{
|
||
|
/// <summary>
|
||
|
/// Initializes a new instance of the <see cref="EmailDomainBlacklistRepository"/> class.
|
||
|
/// </summary>
|
||
|
/// <param name="db">Instance of <see cref="IDbConnectionProvider"/>.</param>
|
||
|
public EmailDomainBlacklistRepository(IDbConnectionProvider db)
|
||
|
: base(db)
|
||
|
{
|
||
|
}
|
||
|
|
||
|
/// <inheritdoc cref="Galaeth.Core.RepositoryInterfaces.IEmailDomainBlacklistRepository" />
|
||
|
public async Task<long> CountEntries()
|
||
|
{
|
||
|
return await WithDatabaseAsync(async connection =>
|
||
|
await connection.QueryFirstAsync<long>($"SELECT COUNT(*) FROM {Table};"));
|
||
|
}
|
||
|
}
|