In C#, how to restrict who can call a method at compile time

前端 未结 4 1388
北恋
北恋 2021-01-15 05:25

In C#, is it possible to restrict who can call a method at compile time?

I\'ve looked into directives, but that didn\'t work since I can\'t assign values to symbols.

4条回答
  •  没有蜡笔的小新
    2021-01-15 06:00

    Can you try using Extensible C# developed by ResolveCorp, some of the links for study and implementation are:

    http://zef.me/782/extensible-c

    http://www.codeproject.com/KB/architecture/DbCwithXCSharp.aspx

    http://weblogs.asp.net/nunitaddin/archive/2003/02/14/2412.aspx

    http://www.devx.com/dotnet/Article/11579/0/page/5

提交回复
热议问题