Using list in a model value in LINQ query

前端 未结 2 428
有刺的猬
有刺的猬 2021-01-15 02:07

I am at very basic stage of asp.net MVC development. So sometimes I struggle with simple LINQ queries to work.

scenario-

I have A page that

2条回答
  •  我在风中等你
    2021-01-15 02:55

    Your cardComment property is a list of strings; it needs to be iterated in order to be displayed. Replace:

    1. @item.cardComment

    with:

      @foreach (var singleComment in Model.cardComment) {
    1. @singleComment
    2. }

提交回复
热议问题