.NET Questions (CLOSED)

Questions and Answers on any aspect of .NET. Now closed.

This discussion group is now closed.

Have a question about .NET development? Try stackoverflow.com, a worldwide community of great developers asking and answering questions 24 hours a day.

The archives of .NET Questions contain years of Q&A. Even older .NET Questions are still online, too.

custom attributes and members accessibility

I'm using custom attributes in some of my classes to form an sql statemment for creating a database where I'm planning to store instances of these classes. There's a class in this hierarcy that has a lot of simple private fields for which I created fake properties that do nothing but marked with the custom attribute (to describe a table's field) and marked them as private. But I found out that they weren't in the resulting sql statement. After I marked one of these private property as public and formed the sql it appered.
The question is - How to use the custom attributes in the way I did, but not exposing these fake properties (not to pollute the class interface)?
Tuesday, January 16, 2007
Make it a class level attribute instead of a property level attribute.  That would avoid the whole issue.
JSmith Send private email
Tuesday, January 16, 2007
By default, when you do reflection to find stuff like custom attributes, the reflection API only returns public (and I think) protected members. If you want to reflect on private stuff, you've got to specify a special flag and be running under full trust.
Chris Tavares Send private email
Wednesday, January 17, 2007

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
Powered by FogBugz