<p>In my ideal world, what I'm looking for would exist as something along the lines of this:</p>

<pre><code>public string UserDefinedField
{
    get { return _userDefinedField; }
    internal set { _userDefinedField = value; }        
    set { _userDefinedField = value; ChangedFields.Add(Fields.UserDefinedField); }
}
</code></pre>

<p>Where one statement is executed regardless of the access modifier, and another statement is executed if it's called from an external assembly or class.</p>

<p>I'm sure I could code something by using reflection and checking up the current call stack to see if the caller is in the same assembly, but I'm looking to see if there's a more elegant approach than that.</p>

```
```
public string UserDefinedField
{
    get { return _userDefinedField; }
    set { SetField(value); ChangedFields.Add(Fields.UserDefinedField); }
}

// Call this from internal methods and use the public property for other cases
internal string SetField(string userValue)
{
    _userDefinedField = userValue;
}
```
```
You
could
get the caller information by
examining the calling stack
but that is extremely slow (compared to the above) and I wouldn't recommend it.