-3

I am not sure what the problem is but what I'm trying to do is to pass argument to a base constructor from a derived class's

error:

Invalid token 'base' in class, struct, or interface member declaration

here is my base class code:

public class EmployeeRegistrationBase
{
    //constructor
    public EmployeeRegistrationBase(string methodName)
    {
       //more code...
    }
}

here is my derived class:

public class USER_REG_LOG_INFO  : base(EmployeeRegistrationBase("some_method_name"))
{
     //more code....
}
Nick Kahn
  • 19,652
  • 91
  • 275
  • 406

1 Answers1

2

Your syntax for inheritance and the constructor passthrough are incorrect. Try this instead:

public class USER_REG_LOG_INFO  : EmployeeRegistrationBase
{
     public USER_REG_LOG_INFO() : base("some_method_name")
     {
     }

     //more code....
}
Dan Puzey
  • 33,626
  • 4
  • 73
  • 96