How to add member variable to an interface in c#

Posted by Nassign on Stack Overflow See other posts from Stack Overflow or by Nassign
Published on 2010-04-08T04:50:33Z Indexed on 2010/04/08 4:53 UTC
Read the original article Hit count: 357

Filed under:
|
|

I know this may be basic but I cannot seem to add a member variable to an interface. I tried inheriting the interface to an abstract class and add member variable to the abstract class but it still does not work. Here is my code:

public interface IBase {
  void AddData();
  void DeleteData();
}

public abstract class AbstractBase : IBase {
  string ErrorMessage;
  abstract AddData();
  abstract DeleteData();
}

© Stack Overflow or respective owner

Related posts about c#

Related posts about interface