Okay, I have two namespaces. One contains my interface and one contains the implementing class. Like this:
namespace Project.DataAccess.Interfaces
{
public i
You're not mentioning in your class declaration that you'll be implementing IAccount
.
Your class declaration should look like this:
class Account : IAccount
{
//Implementation here.
}
Also, what's happening is that you're using the "default" protection level for Account
, and that protection level isn't "public", but an Interface (IAccount
) defines public methods by default.
So, when you preface both the Class and Method names with public
you're actually implementing the interface. Likewise, when you declare SomeMethod
as
IAccount.SomeMethod()
{
//Implementation Here
}
what you're doing is Explicitly Implementing the interface.