问题描述
我试图像这样从前端的对象列表中显示单个属性。 DocumentRepoVaccineTypes是View模型中的对象列表。前端中显示的信息是“ System.Collections.Generic.HashSet`1 [EHS.Entities.DocumentRepositoryVaccineTypes]”列中的
public virtual ICollection<DocumentRepositoryVaccineTypes> DocumentRepoVaccineTypes { get; set; }
<td>
@document.DocumentRepoVaccineTypes
</td>
解决方法
@String.Join(",",document.DocumentRepoVaccineTypes.Select(type => type.SomeProperty))