Alternativas a las interfaces anidadas (no es posible en C #)
Estoy usando interfaces en este caso principalmente como un identificador para una instancia inmutable de un objeto. El problema es que las interfaces anidadas en C # no están permitidas. Aquí está el código:
public interface ICountry
{
ICountryInfo Info { get; }
// Nested interface results in error message:
// Error 13 'ICountryInfo': interfaces cannot declare types
public interface ICountryInfo
{
int Population { get; }
string Note { get; }
}
}
public class Country : ICountry
{
CountryInfo Info { get; set; }
public class CountryInfo : ICountry.ICountryInfo
{
int Population { get; set; }
string Note { get; set; }
.....
}
.....
}
Estoy buscando una alternativa, ¿alguien tendría una solución?