IEnumerable<Addresses> AddressSet1=myServices.GetAddresses(LocationId1);
IEnumerable<Addresses> AddressSet2=myServices.GetAddresses(LocationId2);
我想结合以上两个AddressSets
我试过了IEnumerable<Addresses> AllAddresses=AddressSet1.Concat(AddressSet2)
但在此之后,当我尝试在我的剃刀视图上访问 IEnumerable AllAddresses 中的项目时
@if(!myHelper.IsNullorEmpty(model.AllAddresses )
{
@Html.EditorFor(model => model.AllAddresses )
}
我收到错误 - 路径中有非法字符。有什么建议可以确定导致此错误的原因吗?
如果我试图在没有 Concat 的情况下运行我的页面,我可以看到页面上显示的 AddressSet1 /AddressSet2 中的记录。但是当我尝试将两者结合起来形成 I Enumerable AllAddresses 时,它会抛出错误,请帮助
下面粘贴的是我的编辑器模板
@model MyServiceRole.Models.Addresses
@{
ViewBag.Title = "All addresses Items";
}
<table>
<tr>
<td>
<span>Index</span>
</td>
<td>
</tr>
<tr>
<td>Address XID</td>
<td>
@Html.EditorFor(model => model.AddressID)
</td>
</tr>
<tr>
<td>Title</td>
<td>
@Html.EditorFor(model => model.Title)
</td>
</tr>
<tr>
<td>Description</td>
<td>
@Html.EditorFor(model => model.Description)
</td>
</tr>
<tr>
<td>Image URL</td>
<td>
@Html.EditorFor(model => model.Photo.URL)
</td>
</tr>
</table>