变化的实体访问实体

2023-09-03 01:58:10 作者:无人问津

我想打一个实体的内部。我已经改变了的实体,它的简单属性和导航属性的内部。当我尝试构建它,我得到这个错误:

错误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.