The entity type <type> is not part of the model for the current context

这是在网站里遇到的一个错误,自动生成的不能手动添加,

reference:

http://stackoverflow.com/questions/19695545/the-entity-type-xxx-is-not-part-of-the-model-for-the-current-context

When I created a strong view using the Quickfix context it blew up, because it was trying to associate a class that did not exists in the model. So by deleting all the extra DAL and Model Context, creating my view using the Entity.context that showed up in the Strong view menu everything worked just fine.

通过文本模板自动生成类能解决该问题。

时间: 2024-11-08 21:13:51

The entity type <type> is not part of the model for the current context的相关文章

[C#基础]关于何时使用XmlSerializer的构造函数(Type, Type[])

首先引用msdn上的内容,是关于XmlSerializer的构造函数(Type, Type[])的: 默认情况下,如果某公共属性或字段返回对象或对象数组,则将自动序列化此对象类型.但是,如果某个类包含返回Object类型的数组的字段或属性,则可以将任何对象插入此数组.在此情况下,必须指示 XmlSerializer,请求将要插入到 Object 数组的所有可能的对象类型.若要执行该操作,请使用 extraTypes 参数指定要序列化或反序列化的其他对象类型. 还可以使用 extraTypes 参

[csharp] bool IsNumeric(Type type)

static bool IsNumeric(Type type) { switch (Type.GetTypeCode(type)) { case TypeCode.Byte: case TypeCode.SByte: case TypeCode.UInt16: case TypeCode.UInt32: case TypeCode.UInt64: case TypeCode.Int16: case TypeCode.Int32: case TypeCode.Int64: case TypeCo

XmlSerializer(Type type, Type[] extraTypes) 内存泄漏

在使用XmlSerializer进行序列化或者反序列的时候,对于下面的两个构造方法 XmlSerializer(Type)XmlSerializer.XmlSerializer(Type, String) 为了提高性能,XML 序列化基础结构将动态生成程序集,以序列化和反序列化指定类型.此基础结构将查找并重复使用这些程序集. 但是对于XmlSerializer(Type type, Type[] extraTypes) 等其他的构造函数,则会生成同一程序集的多个版本,且绝不会被卸载,这将导致内存

The model backing the &#39;ProductContext&#39; context has changed since the database was created. EF6

学习<Entity Framework 6 Recipes 2nd Edition>,2-6. Splitting an Entity Among Multiple Tables中遇到几个问题 表结构: 操作 1.构造数据对象 public class Product { [Key] [DatabaseGenerated(DatabaseGeneratedOption.None)] public int SKU { get; set; } public string Description {

Entity Framework初探

参考页面: http://www.yuanjiaocheng.net/entity/change-tracking.html http://www.yuanjiaocheng.net/entity/Persistence-in-EF.html http://www.yuanjiaocheng.net/entity/crud-in-connected.html http://www.yuanjiaocheng.net/entity/crud-in-Disconnected.html http://

XForms XPath函数使用手册

1. 概要 本文所描述的所有函数为XForms 1.1所提供的xpath函数,这些函数只能在GForms的xpath编辑器中可用,这样才能在运行时识别并执行. 不可在XMLUtil.标准XML DOM中使用这些函数. GForms平台提供xpath编辑器,该编辑器可以协助开发者完成大多数xpath表达式开发: 2. 节点函数 2.1. instance node-set instance(string?) An XForms Model can contain more than one ins

System.Security.SecurityException The type initializer for &#39;System.Data.Entity.Internal.AppConfig&#39; threw an exception

[15/08/19 00:03:10] [DataManager-7292-ERROR] System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for 'System.Data.Entity.Internal.AppConf

EF关于报错Self referencing loop detected with type的原因以及解决办法

1)具体报错 { "Message": "出现错误.", "ExceptionMessage": ""ObjectContent`1"类型未能序列化内容类型"application/json; charset=utf-8"的响应正文.", "ExceptionType": "System.InvalidOperationException", &q

AddDbContext was called with configuration, but the context type &#39;NewsContext&#39; only declares a parameterless constructor?

问题 An error occurred while starting the application. ArgumentException: AddDbContext was called with configuration, but the context type 'NewsContext' only declares a parameterless constructor. This means that the configuration passed to AddDbContext