namespace MyOffice.Data.Repositories.Account;

using Models.Accounts;
using MyOffice.Data.Repositories;
using MyOffice.DbContext;

public class AccountAccessRepository : AppRepository<AccountAccess>, IAccountAccessRepository
{
	public AccountAccessRepository(AppDbContext context) : base(context)
	{
	}

	public bool Add(AccountAccess accountAccess)
	{
		return AddBase(accountAccess) > 0;
	}

	public async Task<bool> AddAsync(AccountAccess accountAccess, CancellationToken cancellationToken = default)
	{
		return await AddBaseAsync(accountAccess, cancellationToken) > 0;
	}

	public bool Update(AccountAccess accountAccess)
	{
		return UpdateBase(accountAccess) > 0;
	}

	public async Task<bool> UpdateAsync(AccountAccess accountAccess, CancellationToken cancellationToken = default)
	{
		return await UpdateBaseAsync(accountAccess, cancellationToken) > 0;
	}

	public bool Delete(AccountAccess accountAccess)
	{
		return RemoveBase(accountAccess) > 0;
	}

	public async Task<bool> DeleteAsync(AccountAccess accountAccess, CancellationToken cancellationToken = default)
	{
		return await RemoveBaseAsync(accountAccess, cancellationToken) > 0;
	}
}