简体   繁体   中英

How to give access restriction to DLL's in .net

I have a 3 layer application(UI,Business Layer,Data Layer).My requirement is my datalayer should be only accessible by business layer,and the business layer should be only accessible by UI layer.

That means even if i add a reference of adtalayer in the UI layer,it should not be able to access the methods in Datalayer.

I should be able to create DLL's with access protection.

please suggest a solution for this?

Thanks

SC

您可以标记键类或方法在您的业务和数据层的构造函数internal ,然后使用InternalVisibleTo属性扩展,获得相应的组件。

Sounds to me like what you're looking for is called "policy injection". I'm not sure if this is the easiest or best way, but PostSharp will do what you want.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM