I want to do this:
interface IBase
{
string Property1 { get; }
}
interface IInherited : IBase
{
string Property1 { get; set; }
}
So th
Not explicitly, no. You have two options:
public interface IBase
{
string Property1 { get; }
}
public interface IInherited : IBase
{
void SetProperty1(string value);
}
Or you can just kill the compiler warning with the new
keyword:
public interface IBase
{
string Property1 { get; }
}
public interface IInherited : IBase
{
new string Property1 { get; set; }
}
Unless you implement IInherited.Property1
explicitly, IBase
will bind to your settable implementation automatically.