I am trying to build HTML in my view :
<div class="row contentHeaderInfo">
@foreach (var groupedItems in Model.DSet.GroupBy(a => new {a.rowId}))
{
<ul>
@foreach (var item in groupedItems)
{
<li>@item.Label @item.labelValue</li>
}
</ul>
}
</div>
Data inside the object where rowid = 1 :
groupedItems[0] = {1,"FName","ABC"}
groupedItems[0] = {1,"LaName","DEF"}
groupedItems[0] = {1,"Address",""}
groupedItems[0] = {1,"City","LosAngeles"}
groupedItems[0] = {1,"State","California"}
groupedItems[0] = {1,"Zip","90045"}
groupedItems[0] = {1,"Street","Cardiff"}
groupedItems[0] = {1,"House No","1234"}
groupedItems[0] = {1,"Apt","1"}
For certain label I want to put more than one labelValues inside an <a> tag.
For example If @item.Label = "Address" then I want
<li> Address <a href ="blah"> 1234 Cardiff LosAngeles California 90045 </a></li>
And the rest (apt, house no,city, state, zip) so not appear individually. Is it possible to achieve this with lambda expression?