This commit is contained in:
2026-06-04 09:44:23 +03:00
parent 4ddab34ad1
commit 033b4fc247
29 changed files with 3661 additions and 59 deletions
@@ -0,0 +1,11 @@
using MyOffice.Data.Models.Verifications;
namespace MyOffice.Data.Repositories.Item;
public interface IVerificationCodeRepository
{
VerificationCode? GetByCode(string code);
bool Add(VerificationCode entity);
bool Update(VerificationCode entity);
}
@@ -0,0 +1,22 @@
namespace MyOffice.Data.Repositories.Item;
using Microsoft.EntityFrameworkCore;
using MyOffice.Data.Models.Verifications;
public class VerificationCodeRepository : AppRepository<VerificationCode>, IVerificationCodeRepository
{
public bool Add(VerificationCode entity)
{
return AddBase(entity) > 0;
}
public bool Update(VerificationCode entity)
{
return UpdateBase(entity) > 0;
}
public VerificationCode? GetByCode(string code)
{
return _context.Verifications.FirstOrDefault(x => x.Code == code);
}
}