相关疑难解决方法(0)

85
推荐指数
2
解决办法
9万
查看次数

LINQ to Entities无法识别方法'System.String ToString()'方法,并且此方法无法转换为存储表达式

我在asp.net mvc应用程序中有以下视图: -

 @model MvcApplication4.Models.ContactsDetails
     <h3>Select Contacts Detials</h3>
    <p class="dashboarder" style = "color:#5c87b2"><strong>@Model.Info.Count()</strong> Selected Customers Accounts.</p>
    @using (Html.BeginForm("Export", null))
    {
        Int32 c = -1;
        <table>
            <tr>
                <th>
                    Account Name @Html.CheckBox("IncludeAccountName", true)
                </th>
                <th>
                    Name @Html.CheckBox("IncludeName", true)
                </th>
Run Code Online (Sandbox Code Playgroud)

使用以下操作方法填充: -

public ActionResult CustomersDetails(long[] SelectRight)
{

    if (SelectRight == null)
    {
        return RedirectToAction("customer", new { isError = true });
    }
    else
    {

        var ContactsDetails2 = new ContactsDetails
        {
            Info = r.getcontactinfo(SelectRight)
        };
        return View(ContactsDetails2);

    }          


}
Run Code Online (Sandbox Code Playgroud)

然后是以下存储库方法: -

public IEnumerable<AaaUserContactInfo> getcontactinfo(long[] id) …
Run Code Online (Sandbox Code Playgroud)

c# linq asp.net-mvc entity-framework

2
推荐指数
1
解决办法
7081
查看次数

标签 统计

c# ×2

asp.net-mvc ×1

entity-framework ×1

foreach ×1

linq ×1