Seeding, cleanup, fix nginx proxying

This commit is contained in:
lumijiez
2025-06-09 23:54:37 +03:00
parent c2c4b739f1
commit dd7eeb9eea
32 changed files with 439 additions and 240 deletions

View File

@@ -1,36 +0,0 @@
using Imprink.Domain.Entities.Users;
using Imprink.Domain.Repositories;
using Imprink.Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
namespace Imprink.Infrastructure.Repositories;
public class RoleRepository(ApplicationDbContext context) : IRoleRepository
{
public async Task<IEnumerable<Role>> GetAllRolesAsync(CancellationToken cancellationToken = default)
{
return await context.Roles
.AsNoTracking()
.ToListAsync(cancellationToken);
}
public async Task<Role?> GetRoleByIdAsync(Guid roleId, CancellationToken cancellationToken = default)
{
return await context.Roles
.AsNoTracking()
.FirstOrDefaultAsync(r => r.Id == roleId, cancellationToken);
}
public async Task<Role?> GetRoleByNameAsync(string roleName, CancellationToken cancellationToken = default)
{
return await context.Roles
.AsNoTracking()
.FirstOrDefaultAsync(r => r.RoleName == roleName, cancellationToken);
}
public async Task<bool> RoleExistsAsync(Guid roleId, CancellationToken cancellationToken = default)
{
return await context.Roles
.AnyAsync(r => r.Id == roleId, cancellationToken);
}
}