I'm using ASP.Net Core 2.0 with Entity Framework and I am trying to return a model to a page that contains the Employment entity with it's collection of EmploymentDocument entities also included. For the latter I do not want to load the data (byte[]) column but I do want all the other columns, most importantly FileName.
The linq query I have which loads everything including the data column is:
var employment = await _context.Employment
.Include(e => e.EmploymentDocuments) // will load all associated document data
.SingleOrDefaultAsync(m => m.EmploymentID == id);
The purpose here is to be able to show a list of all the document names on the page with links that can then be used to download the data for the file selected.