public class MiddlewareBase { public Request CurrentRequest; public LocalIni iniFile; private Database _database; public Database database { get { return _database; } set { _database = value; } } internal String CurrentSalespoint { get; private set; } internal String CurrentOperator { get; private set; } internal Int16 nPrefsSiteNo { get; set; } internal Int16 nClientNumber { get; set; } public static readonly DateTime DTSqlMinDate = DateTime.Parse("1900-01-01"); public static readonly String ServerName = "SalesEZ"; //"Siriusware.Middleware"; // used to be SalesEZ public static readonly String GenericOperator = "SEZDTL"; // used in lcDTL in ValidatePass2 public MiddlewareBase() { iniFile = new LocalIni(); }I have several classes that inherit from this class.
this.nPrefsSiteNo = (Int16)database.GetPreferenceInt("prefs", "site_no");I want to move this logic into the base class. However, I can not call it in constructor as the database is not defined at that point.