0

I am new to c#.

I got an interface that I need to implement, including this line in the interface:

    public abstract IEnumerable<CardData> AllCards { get; }

In my implementation I have this code:

    public IEnumerable<CardData> AllCards { 
        get { return cards as IEnumerable<CardData>; }
    }

but I get an error saying:

error CS0534: 'CardDatabaseImpl' does not implement inherited abstract member 'CardDatabase.AllCards.get'

referring to this line in the code.

Any advice?

error message

moran
  • 1

2 Answers2

1

Take a look at the documentation for the abstract keyword. You need to use the override keyword in the implementing class.

Xerillio
  • 4,855
  • 1
  • 17
  • 28
1

Well, it seems that you're using abstract class, not interface. In this case just override this method. Or use interface (without abstract keyword), and you will not need to override it, just implement. See this question to get the differences between interface and abstract class

ba-a-aton
  • 574
  • 1
  • 4
  • 14