feat(ReadProfile): add logic to read buttons

This commit is contained in:
2025-07-29 22:09:11 +02:00
parent 82eb03b420
commit 27e4b4b2ef
7 changed files with 43 additions and 25 deletions

View File

@@ -15,6 +15,7 @@ public static class DependencyInjection
services.TryAddScoped<IProfileRepository, ProfileRepository>();
services.TryAddScoped<IProfileObjRepository, ProfileObjRepository>();
services.TryAddScoped<IStateRepository, StateRepository>();
services.TryAddScoped<IButtonRepository, ButtonRepository>();
return services;
}
}

View File

@@ -1,5 +1,6 @@
using DigitalData.Core.Abstractions.Infrastructure;
using DigitalData.Core.Infrastructure;
using Microsoft.EntityFrameworkCore;
using WorkFlow.Application.Contracts.Repositories;
using WorkFlow.Domain.Entities;
@@ -11,4 +12,6 @@ public class ButtonRepository : CRUDRepository<Button, int, WFDBContext>, IButto
public ButtonRepository(WFDBContext dbContext) : base(dbContext, dbContext.Buttons)
{
}
public async Task<IEnumerable<Button>> ReadAllAsync(int profileId) => await _dbSet.Where(b => b.ProfileId == profileId).ToListAsync();
}