变化的实体访问 [英] Changing Entity accessibility
问题描述
我想打一个实体的内部。我已经改变了的实体,它的简单属性和导航属性的内部。当我尝试构建它,我得到这个错误:
错误6036:的EntityType'文件'有'内部'可及性和EntitySet的'文件'与'公共'访问一个获取属性。的EntitySet的get属性必须不能比含有的EntityType的访问限制较少的访问。的
这个错误,因为它不产生我不能编辑designer.cs。我检查EDMX文件,但目前还没有相关的文件或文件任何公共价值。我该怎么办?
- 打开模式,在VS实体设计。
- 切换到模型浏览器窗口。
- 展开以下节点:
- ModelName.edmx
- 型号
- 在实体类型
- 复杂类型
- 协会
- EntityContainer相关:MyEntities
- 在实体集
- 在实体集列表中,您应该看到文件的条目。点击它。
- 切换到属性编辑器窗口,并改变吸气的知名度。
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屋!