![](/img/trans.png)
[英]Error The model item passed into the dictionary is of type 'System.Data.Entity.DynamicProxies
[英]The model item passed into the dictionary is of type 'System.Data.Entity.DynamicProxies… and requires a model item of type
当我在“ Firmas”(通用自动生成的MS代码)的索引中启动“ Details”时出现此错误:
这是我的模型:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using actiTest2.Context;
using System.Data.Entity;
namespace actiTest2.Models
{
public class PcontacFirmasModel
{
public Pcontac pcontac { get; set; }
public Firmas firmas { get; set; }
}
}
我尝试做atm的唯一电话:
@model actiTest2.Models.PcontacFirmasModel
@{
ViewBag.Title = Html.DisplayFor(model => model.firmas.NOMCOMP);
}
似乎在控制器端,您正在传递类型为“ Firmas”的对象,但是您的视图期望使用的对象为“ PcontacFirmasModel”。
更新您的操作以发送PcontacFirmasModel对象。 您可以使用mapper实用程序来映射PcontacFirmasModel和Firmas。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.