Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Read only property
Message
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
01095599
Message ID:
01095601
Views:
10
Hi Einar,

It looks like you want to modify the visibility of the set accessor, so you can work with the property internally but restrict it externally?

Asymmetric Accessor Accessibility was added to C#2.0 , this lets you add the keyword 'internal' to either a get or set accessor to restrict it's visibility.

the only caveat is you must always have both the get and the set accessor to use this function, should be fine for your example.
public string MyProp
{
    get { return this.myProp; }
    internal set { this.myProp = value; }
}
- Craig
- Craig

"If you're not prepared to be wrong, you will never come up with anything original."
- Sir Ken Robinson
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform