I am looking to \'extending\' an interface by providing set accessors to properties in that interface. The interface looks something like this:
interface IUser
I don't see any reason why what you have posted shouldn't work? Just did a quick test and it compiles alright, but gives a warning about hiding. This can be fixed by adding the new keyword, like this:
public interface IMutableUser : IUser
{
new string Username { get; set; }
}
An alternative would be to add explicit set methods; eg:
public interface IMutableUser : IUser
{
void SetUsername(string value);
}
Of course, I'd prefer to use setters, but if it's not possible, I guess you do what you have to.