In c# version 8 (or higher) we're able to create internal member in interfaces. For example, I have project A that have interface IRunnable
with internal void:
public interface IRunnable
{
internal void DoSomeInternalStuff();
}
Now, I have Student
class in project A that implements IRunnable
:
public class Student : IRunnable
{
void IRunnable.DoSomeInternalStuff()
{
//Do stuff
}
}
Everything is working. But now, I created project B and created class Teacher
. Now I want to implement IRunnable
:
public class Teacher : IRunnable
{
void IRunnable.DoSomeInternalStuff()
{
//Do stuff
}
}
The compiler is giving me an error:
IRunnable.DoSomeInternalStuff()' is inaccessible due to its protection
How to deal with this? How can I implement that interface on project B?