What would be the best way to implement the following?
I have a set of objects that implement an interface, internally I want to be able to expose the set and get properties and get only external ones.
Here is an example of what I want ... It does not compile.
public interface ITable
{
string Name { get; }
}
internal interface IInternalTable
{
string Name { get; set; }
}
internal class Table : ITable, IInternalTable
{
public string Name { get; set; }
public string ITable.Name { get { return Name; } }
}
public class Database
{
private List<IInternalTable> tables;
public List<ITable>
{
get { return this.tables; }
}
}
source
share