部分类不匹配自动生成的类部分

编程入门 行业动态 更新时间:2024-10-25 00:27:33
本文介绍了部分类不匹配自动生成的类部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我创建的实体模型,我的数据库类,这里就是其中之一:

I've created entity model for my DB classes, here is one of them:

[EdmEntityTypeAttribute(NamespaceName="SotiModel", Name="SKUPrice")] [Serializable()] [DataContractAttribute(IsReference=true)] public partial class SKUPrice : EntityObject { ... }

和他们中的一个在部分类

and created partial class for one of them

public partial class SKUPrice { }

这里的问题是,部分世界是用光的颜色和ReSharper的建议:的部分有一个零件类

这似乎是部分类的我自己的一部分是不相匹配的主要部分...

It seems like my 'own' part of partial class is not matched to the 'main' part...

为什么呢?如何解决呢?

Why? How to fix that?

非常感谢!

P.S。我在VS2010的工作,在Windows7的(64位)

P.S. I'm working in VS2010, under Windows7 (64bit)

我不知道什么是真正的问题,但由于某些原因,如果我从一个文件复制/粘贴类源$ C ​​$ C到另一个,之后改名类名和元数据类名的名字 - 这是不是由Visual Studio为有效类的考虑。

I don't know what is actually a problem, but due to some reason if I copy/paste class source code from one file to another and after that rename class name and name of metadata class name - that is not 'considered' by Visual studio as valid class.

如果我删除的文件与破类,manualy TYPE一​​切从头开始 - 文件是由工作室接受...

If I delete file with that "broken" class, and TYPE EVERYTHING manualy from scratch - file is accepted by studio...

奇怪的和愚蠢的事情......但......

Strange and stupid thing... but it is...

如果你知道为什么会发生 - 请让我知道

If you know why it happens - please let me know.

感谢。

推荐答案

每个类的定义必须在同一个命名空间对它们进行正确的匹配。

Each class definition must be in the same namespace for them to be correctly matched.

更多推荐

部分类不匹配自动生成的类部分

本文发布于:2023-11-05 19:11:41,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1561622.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:自动生成   不匹配

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!