Mapping a model into a dto and 'include' only the key of child element
问题 I have the following Project model: public class Project { [Key] public int ProjectID { get; set; } public string Name { get; set; } public string Description { get; set; } public virtual ICollection<Screenshot> Screenshots { get; set; } } And I have the following Screenshot model: public class Screenshot { [Key] public int ScreenshotID { get; set; } public string ScreenshotName { get; set; } public byte[] ScreenshotContent { get; set; } public string ScreenshotContentType { get; set; } } As