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

@ -96,10 +96,14 @@ namespace InternshipSystem.Api.Controllers
await _context.Entry(edition) await _context.Entry(edition)
.Collection(e => e.Internships) .Collection(e => e.Internships)
.Query() .Query()
.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();