Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Internal enum ?
Message
 
To
27/05/2014 11:51:58
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
Environment versions
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01600724
Message ID:
01600737
Views:
64
This message has been marked as a message which has helped to the initial question of the thread.
Why not just make it public? Internal is meant to be well internal and if you need to expose outside of the original assembly you probably should use public.

Friend behavior can be useful, but you really have to ask yourself whether it's worth the hassle for a semantic aspect to try to preserve internal visibility - especially for a constant (enum) that has no functionality that can be abused externally.

+++ Rick ---

>Hi everybody,
>
>I introduced internal enum in my class. I have a method that returns value of that enum. I want to be able to test that method in a test project which is part of my solution.
>
>I added the following line to my class code at the very top
>
>
>[assembly: InternalsVisibleTo("TestProject")]
>
>As a result I am able to see the methods of the class, but I am unable to declare a variable of the type my enum.
>
>Other than making that enum public is there another solution?
>
>Thanks in advance.
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform