can't implement properties in interface. define it on interface.
public interface IMyInterface
{
string Instance
{
get;
set;
}
}
Then in the implementing class, you need to implement it
class MyClass: IMyInterface{
private string instance ;
public string Instance {
get {
return this.instance;
}
set {
this.instance= value;
}
}
}
if all the property interfaces are same for the sub classes then you can try with
abstract
class like below
public abstract class MyAbstractClass
{
public string Instance { get; set; }
public int Sugar { get; set; }
public int AddSugar { get; set; }
public string Milk { get; set; }
public abstract void Description();
}
public class MyClass : MyAbstractClass
{
public override void Description()
{
Console.WriteLine("Hello, what kind of coffee would you like to have?");
}
}