fix/scan #80

Merged
maxchil merged 2 commits from fix/scan into master 2020-11-12 00:27:18 +01:00
Showing only changes of commit b80372b367 - Show all commits

View File

@ -99,7 +99,11 @@ namespace InternshipSystem.Api.Controllers
.Include(i => i.Documentation) .Include(i => i.Documentation)
.FirstAsync(i => i.Student.Id == user.PersonNumber, cancellationToken); .FirstAsync(i => i.Student.Id == user.PersonNumber, cancellationToken);
var document = internship.Documentation.First(d => d.Id == documentId); var document = await _context.Entry(internship)
.Collection(i => i.Documentation)
.Query()
.Include(d => d.Scan)
.FirstAsync(d => d.Id == documentId, cancellationToken);
document.Scan ??= new DocumentScan(); document.Scan ??= new DocumentScan();