How can i hide “setters” from all but one assembly?

前端 未结 3 1654
执念已碎
执念已碎 2021-01-15 17:23

I have alluded to this issue in my other question, but i think it\'s worthwhile breaking it out into its own question, as it\'s not really dependant on the other scenarios i

3条回答
  •  迷失自我
    2021-01-15 17:59

    Mark all your setters as internal, then add the InternalsVisibleTo Attribute to your POCOs assembly:

     [assembly: InternalsVisibleTo( "MyCompany.MyProject.Repositories" )]  
    

提交回复
热议问题