Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Maybe I'm just missing the point, but you should explicitly call the base class constructors in your hierarchy.</p> <p>This should work:</p> <pre><code>// Level 0 (Root Base Class) public abstract class BusinessDataControllerBase&lt;BDA&gt; : IBusinessDataController { protected BDA da; public BusinessDataControllerBase() { // Initialize the respective Data Access Layer passed by the concrete class this.da = new BDA(); } } // Level 1 (Second Level Base Class) public abstract class BusinessRootDataControllerBase&lt;BDA&gt; : BusinessDataControllerBase&lt;BDA&gt;, IBusinessRootDataController where BDA : IBusinessDALController, new() { public BusinessRootDataControllerBase() : base() {} } // Level 2 (Third Level Base Class) public abstract class BusinessMasterRootDataControllerBase&lt;BRC, BRD, BDA&gt; : BusinessRootDataControllerBase&lt;BDA&gt;, IDisposable where BRC : IBusinessRootDataController where BRD : IBusinessRootData where BDA : IBusinessDALController, new() { public BusinessMasterRootDataControllerBase() : base() {} } // Level 3 (Concrete Class) public class UserController : BusinessMasterRootDataControllerBase&lt;UserController, UserData, UsersDAL&gt; { # region Singleton implementation - Private Constructor, Static initialization private static readonly UserController instance = new UserController(); public static UserController Instance { get { return instance; } } # endregion # region Constructor // -------------------------------------------------------------------------------- //Private Constuctor private UserController() : base() { } // -------------------------------------------------------------------------------- private void DoLogin(string userName, string password) { DataSet dstUser = da.GetUser(userName); // Check user name // Check password } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload