Back to list
Views:   5.1K
Replies:  0
Archived

.NET 2.0. Decorate a property with attribute for a class that's in the same assembly

Hello folks,

I've a class with several properties, of which some are mandatory.
The consuming class will take action depending on whether properties are mandatory.

So: 
If property 'InvoiceNumber' is mandatory then
  'do stuff

It seems that doing this in .NET 2.0, this is fairly convoluted. See this article:
http://msdn.microsoft.com/en-us/library/system.reflection.customattributedata%28v=VS.80%29.aspx

It involves loading an assembly and then use reflection.  This doesn't make sense, i.e. loading an assembly, if the class that I'm examining resides in the same assembly!

Any advice appreciated.

Ta,
Yogi

Chr Yoker, Oct 26, 2010


Stay Inspired!
Join other developers and designers who have already signed up for our mailing list.
Terms     Privacy     Licensing       EULA       Sitemap      
© Data & Object Factory, LLC.
Made with    in Austin, Texas.      Vsn 1.3.0