更改实体可访问性 [英] Changing Entity accessibility
问题描述
错误6036:EntityType'File'具有'Internal'可访问性,EntitySet'Files'获得具有公共可访问性的财产。 EntitySet的get属性不能比包含EntityType的访问更少的限制性访问。
由于此错误,我无法编辑designer.cs,因此不会生成。我检查了edmx文件,但没有任何与文件或文件相关联的公共值。我应该怎么做?
- 在VS实体设计器中打开模型。
- 切换到模型浏览器窗口。
- 展开以下节点:
- ModelName.edmx
- 模型
- 实体类型
- 复杂类型
- 关联
- EntityContainer:MyEntities
- 实体集
- 模型
- 实体集列表,您应该看到文件的条目。点击它。
- 切换到属性编辑器窗口并更改Getter的可见性。
I want to make an entity internal. I've changed entity, its scalar properties and navigation properties to internal. I'm getting this error when I try to build it:
Error 6036: EntityType 'File' has 'Internal' accessibility and EntitySet 'Files' has a get property with 'Public' accessibility. EntitySet's get property must not have less restrictive access than containing EntityType's access.
I can't edit designer.cs because of this error it isn't generated. I've checked edmx file but there aren't any public values associated to "File" or "Files". What should I do?
- Open the model in the VS entity designer.
- Switch to the Model Browser window.
- Expand the following nodes:
- ModelName.edmx
- Model
- Entity Types
- Complex Types
- Associations
- EntityContainer: MyEntities
- Entity Sets
- In the "Entity Sets" list you should see an entry for "Files". Click it.
- Switch to the property editor window and change the Getter visibility.
这篇关于更改实体可访问性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!