Use of Attributes and Their Life


well started using attributes , got few problems already... thats why wanna ask few questions them.

have written custom made attribute asp winapi filtering (custom attribute implementing iactionfilter , iexceptionfilter). let's suppose wanna have instance variable inside attribute. how behave in runtime? call actionfilter , exceptionfilter use same instance of it? , how gc treat attributes? bound life of class instance? should put instance variables inside attributes?

attributes treated metadata "whatever code consume function" read, runtime or components.

that means shares same lifetime class/member attached with.

btw, attribute parameters stored instance variable. "name" in datamemberattribute. it is queried whatever data-binding control bind to... or not read @ all. said in beginning, depends on whether whatever consuming knows/wants use it. otherwise has no effect @ all.




Visual Studio Languages  ,  .NET Framework  >  Visual C#



Comments

Popular posts from this blog

Azure DocumentDB Owner resource does not exist

job syspolicy_purge_history job fail in sqlserver 2008

Trying to register with public marketplace error with 'Get-AzureStackStampInformation'