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....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top