You can define Code Access Security in your code either using declarative syntax or using imperative syntax. While you use attributes to define Code Access Security declaratively, the imperative syntax used runtime method calls.