|
-
Aug 20th, 2015, 09:07 AM
#13
Re: [RESOLVED] How to write this more compact?
 Originally Posted by MrNorth
...Nice touch with the attributes, but it feels in my case like an overly complicated way to solve this since I have to introduce an enum flag which is not needed (the Both)...
Just to be clear, the only reason that I decorated the Enum with the 'Flags' attribute is because you implied that you were using the Enum as a such. The 'Flags' attribute is no relation to applying other attributes.
However, as dbasnett noted, your value of '4' is not correct for the 'Both' or 'US_Metric' field in the implied usage and should be have a value of '3'.
I completely agree that the attribute route to add information is overkill for this case of mapping only three key-value pairs and it could probably be best handled with a Module (static class).
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|