Re: Question about attributes...

From: Eran Kampf (eran_at_ekampf.com)
Date: 11/01/04


Date: Mon, 1 Nov 2004 14:17:47 +0200

You can't....
Attributes allow you to place extra descriptive information into metadata
that can be extracted using runtime reflection services.
Attributes do not actually execute (to perform tasks like parameter checking
etc...)

I guess what you're trying to do is what XC# features.... check it out at
http://www.resolvecorp.com/default.aspx

Eran Kampf
http://www.ekampf.com

"Girish" <girish@in-reality.com> wrote in message
news:OQKXyZAwEHA.2568@TK2MSFTNGP11.phx.gbl...
> If I have something like that
>
> class TestNegativeValue:Attribute
> {
> // ...
> }
> ...
> [TestNegativeValue]
> public void ExceptionNegativeValue(int i)
> {
> //...
> }
>
> how can I test i(throw exception if i<0) directly
> from the attribute body ?
>
> Thanks.
> Girish



Relevant Pages

  • Re: Security in EM
    ... you cannot hide the metadata. ... Any user in a database can execute sp_help ... (which is basically what is running behind the scenes when you click on an ...
    (microsoft.public.sqlserver.security)
  • Re: metadata for Storedprocedure
    ... as output parameters may also return a different type of result set ... depending on arguments or time of day too. ... know/report the metadata about the result set they might return. ... Therefore, even if you *do* execute the procedure, and obtain the ...
    (comp.lang.java.databases)
  • Re: Any free way to create unreadable exe file yet?
    ... Indeed, you are right, the CLR needs all metadata ... ..NET Runtime still requires that *the complete metadata and IL* be ... included in an assembly before it is allowed to execute). ...
    (microsoft.public.dotnet.languages.csharp)