Refactored

This commit is contained in:
2026-03-04 23:12:44 +01:00
parent ef6305919d
commit 0013bb18df
4 changed files with 13 additions and 11 deletions

View File

@@ -58,11 +58,18 @@ public class WhiteboardRepository
entity.State = model.State;
}
public async Task<bool> WhiteboardCodeExists(WhiteboardCode whiteboardCode)
public async Task<bool> WhiteboardCodeExistsAsync(WhiteboardCode whiteboardCode)
{
return await Context.Whiteboards.AnyAsync(w => w.Code == whiteboardCode.CodeValue);
}
public async Task<Domain.Models.Whiteboard.Whiteboard?> GetByCodeAsync(WhiteboardCode whiteboardCode, CancellationToken cancellationToken = default)
{
var entity = await Context.Whiteboards.FirstOrDefaultAsync(w => w.Code == whiteboardCode.CodeValue, cancellationToken);
return entity != null ? MapToModel(entity) : null;
}
public async Task SoftDeleteAsync(WhiteboardId id, CancellationToken cancellationToken = default)
{
var entity = await Context.Whiteboards.FindAsync([new Guid(id.IdValue)], cancellationToken);