internal setter on a public interface?

  • Thread starter Thread starter not_a_commie
  • Start date Start date
N

not_a_commie

I want

public interface IDD{
Guid ID { get; internal set; }
}

The compiler doesn't like the restricted scope in the interface. Is
there some right way to do this?
 
No. Anything on an interface is publically available, but you can do this

public interface INamedEntity
{
public string Name { get; }
}

public class Person : INamedLicense
{
public string Name { get; internal set; }
}
 
No. Anything on an interface is publically available, but you can do this

public interface INamedEntity
{
public string Name { get; }
}

public class Person : INamedLicense
{
public string Name { get; internal set; }
}

Heh. Assuming, of course, you get the interface names correct....
 
Back
Top