EF Core Beziehungskonfiguration für Envelope-Entität korrigiert
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
using DigitalData.UserManager.Infrastructure.Repositories;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
using EnvelopeGenerator.Infrastructure.Contracts;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace EnvelopeGenerator.Infrastructure.Repositories
|
||||
{
|
||||
@@ -10,5 +11,21 @@ namespace EnvelopeGenerator.Infrastructure.Repositories
|
||||
public EnvelopeRepository(EGDbContext dbContext) : base(dbContext)
|
||||
{
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<Envelope>> ReadAllWithAsync(bool documents = false, bool receivers = false, bool history = false)
|
||||
{
|
||||
var query = _dbSet.AsQueryable();
|
||||
|
||||
if (documents)
|
||||
query = query.Include(e => e.Documents);
|
||||
|
||||
if (receivers)
|
||||
query = query.Include(e => e.Receivers);
|
||||
|
||||
if (history)
|
||||
query = query.Include(e => e.History);
|
||||
|
||||
return await query.ToListAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user