- Ersetzt die Erstellung von DbSet pro Entität durch DbSet-Eigenschaften in `EGDbContext`. - Hinzugefügt DbSet-Eigenschaften für `UserReceiver`, `Config`, `EnvelopeReceiver` und `Envelope`. - Aktualisierter `EGDbContext`-Konstruktor zur Initialisierung der DbSet-Eigenschaften mittels der `Set<T>`-Methode.
20 lines
638 B
C#
20 lines
638 B
C#
using DigitalData.Core.Infrastructure;
|
|
using EnvelopeGenerator.Domain.Entities;
|
|
using EnvelopeGenerator.Infrastructure.Contracts;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace EnvelopeGenerator.Infrastructure.Repositories
|
|
{
|
|
public class ConfigRepository : CRUDRepository<Config, int, EGDbContext>, IConfigRepository
|
|
{
|
|
public ConfigRepository(EGDbContext dbContext) : base(dbContext, dbContext.Configs)
|
|
{
|
|
}
|
|
|
|
public async Task<Config?> ReadFirstAsync()
|
|
{
|
|
var configs = await _dbSet.ToListAsync();
|
|
return configs.Count > 0 ? configs[0] : default;
|
|
}
|
|
}
|
|
} |