Attributes
Posted: Sun Oct 17, 2010 3:50 pm
I've written an attribute with a property roles as Lists<of String>. When I want to use the attribute and assign something to roles, the compiler returns
Code of the Attribute
Code where I use the attribute
Maybe I made some stupid error I overlooked, I really need to get some sleep now But could it be the compiler is looking for a property the C# way, with a capitalized first letter?
- Code: Select all
error: "Roles" is not a valid named attribute argument because it is not a valid attribute parameter type
Code of the Attribute
- Code: Select all
class AuthenticationAttribute inherits FilterAttribute
has AttributeUsage(AttributeTargets.Class, allowMultiple = false, inherited = true), Serializable
pro roles from var as List<of String>
cue init()
base.init(ExecuteWhen.BeforeAction, AuthenticationFilter)
Code where I use the attribute
- Code: Select all
class AdminController inherits ARSmartDispatcherController
has AuthenticationAttribute(roles = ["admin"])
Maybe I made some stupid error I overlooked, I really need to get some sleep now But could it be the compiler is looking for a property the C# way, with a capitalized first letter?