c# - Applying attributes to the Partial classes -


following partial class:

// file - designcontroller.cs  [authorize] public partial class designercontroller : apicontroller {    // code }  [authorize] public partial class designercontroller {    // code } 

i need understand usage of [authorize] or similar attribute on class, fine have on 1 of partial class definition or of them have it. current code compiling need understand runtime issues of above implementation

on partial classes attributes merged @ compilation time, yes, can have on 1 class.

example:

[obsolete] public partial class foo {}  [authorize] public partial class foo {} 

compiles to:

[obsolete] [authorize] public partial class foo {} 

for further information on can @ msdn: partial classes , methods


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -